{"action":"opened","issue":{"url":"https://api.github.com/repos/pramttl/tstl/issues/5","labels_url":"https://api.github.com/repos/pramttl/tstl/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/pramttl/tstl/issues/5/comments","events_url":"https://api.github.com/repos/pramttl/tstl/issues/5/events","html_url":"https://github.com/pramttl/tstl/issues/5","id":61775172,"number":5,"title":"Importing harnessmaker requires act file else gives ValueError","user":{"login":"pramttl","id":933802,"avatar_url":"https://avatars.githubusercontent.com/u/933802?v=3","gravatar_id":"","url":"https://api.github.com/users/pramttl","html_url":"https://github.com/pramttl","followers_url":"https://api.github.com/users/pramttl/followers","following_url":"https://api.github.com/users/pramttl/following{/other_user}","gists_url":"https://api.github.com/users/pramttl/gists{/gist_id}","starred_url":"https://api.github.com/users/pramttl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pramttl/subscriptions","organizations_url":"https://api.github.com/users/pramttl/orgs","repos_url":"https://api.github.com/users/pramttl/repos","events_url":"https://api.github.com/users/pramttl/events{/privacy}","received_events_url":"https://api.github.com/users/pramttl/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-03-15T08:23:27Z","updated_at":"2015-03-15T08:23:27Z","closed_at":null,"body":"Importing harnessmaker should not require act file. Currently the following error results when harnessmaker is imported `ValueError: The .act file is not specified`. It makes it hard to import harnessmaker in a tests file to test the code within it. Only time when act file should be required is when harnessmaker is explicitly run by using `python harnessmaker.py` ...\r\n\r\n**Solution**: Code needs refactoring code into main() and separating the functions out.\r\n\r\n```\r\n(venv)pranjal:~/projects/ase_cs562/tstl/src$ python\r\nPython 2.7.8 (default, Oct 19 2014, 16:02:00)\r\n[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.54)] on darwin\r\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\r\n>>> import harnesmaker\r\nTraceback (most recent call last):\r\n  File \"<stdin>\", line 1, in <module>\r\nImportError: No module named harnesmaker\r\n>>> import harnessmaker\r\nusage: [-h] [-a ACT] [-t TARGET] [-c CLASSNAME] [-n] [-r] [-i]\r\n\r\noptional arguments:\r\n  -h, --help            show this help message and exit\r\n  -a ACT, --act ACT     Path to the .act file.\r\n  -t TARGET, --target TARGET\r\n                        Name of the file containing the generated harness core\r\n                        (default = sut.py)\r\n  -c CLASSNAME, --classname CLASSNAME\r\n                        Name of the class representing the SUT (default=t)\r\n  -n, --nocover         Disable generating coverage collection support.\r\n  -r, --coverreload     Generate coverage for module reload behavior.\r\n  -i, --coverinit       Generate coverage for SUT initialization behavior.\r\nTraceback (most recent call last):\r\n  File \"<stdin>\", line 1, in <module>\r\n  File \"harnessmaker.py\", line 56, in <module>\r\n    config = make_config(parsed_args, parser)\r\n  File \"harnessmaker.py\", line 38, in make_config\r\n    raise ValueError('The .act file is not specified.')\r\nValueError: The .act file is not specified.\r\n>>>\r\n```"}}