{"action":"created","issue":{"url":"https://api.github.com/repos/networktocode/ntc-templates/issues/5","repository_url":"https://api.github.com/repos/networktocode/ntc-templates","labels_url":"https://api.github.com/repos/networktocode/ntc-templates/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/networktocode/ntc-templates/issues/5/comments","events_url":"https://api.github.com/repos/networktocode/ntc-templates/issues/5/events","html_url":"https://github.com/networktocode/ntc-templates/pull/5","id":154725538,"number":5,"title":"Added test environment using pytest","user":{"login":"ogenstad","id":6694669,"avatar_url":"https://avatars.githubusercontent.com/u/6694669?v=3","gravatar_id":"","url":"https://api.github.com/users/ogenstad","html_url":"https://github.com/ogenstad","followers_url":"https://api.github.com/users/ogenstad/followers","following_url":"https://api.github.com/users/ogenstad/following{/other_user}","gists_url":"https://api.github.com/users/ogenstad/gists{/gist_id}","starred_url":"https://api.github.com/users/ogenstad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ogenstad/subscriptions","organizations_url":"https://api.github.com/users/ogenstad/orgs","repos_url":"https://api.github.com/users/ogenstad/repos","events_url":"https://api.github.com/users/ogenstad/events{/privacy}","received_events_url":"https://api.github.com/users/ogenstad/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-05-13T14:32:01Z","updated_at":"2016-10-05T12:26:56Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/networktocode/ntc-templates/pulls/5","html_url":"https://github.com/networktocode/ntc-templates/pull/5","diff_url":"https://github.com/networktocode/ntc-templates/pull/5.diff","patch_url":"https://github.com/networktocode/ntc-templates/pull/5.patch"},"body":"As I mentioned in the chat I created a new testing environment with more thorough tests which tests more scenarios than the current tests. It's also quite a lot quicker and it's easier to see what is wrong when the tests fail.\r\n\r\nI made some changes to tox.ini, since this isn't currently used by Travis it shouldn't impact anything else.\r\n\r\nTo test how this works you can just try this in the ntc-template root:\r\n```bash\r\npip install tox\r\ntox\r\n```\r\n\r\nCurrently there are a few issues which these tests pick up that the current tests didn't. Such as the \"show interfaces status\" template which was fixed yesterday and the \"show ip ospf neighbor\" template. \r\n\r\nAlso there are some duplicate lines in one of the reference files. Other parsed files are not in the same order as the actual data. In order to fix this the tests could sort the lists before comparing, or the parsed data could be changed.\r\n\r\nI also made some changes to tox.ini to make it easier to run the Ansible tests without caring about the environment. You can just run tox and it will setup the requirements. However currently the Ansible tests are run after the pytest tests and since the pytest tests fail due to the incorrect data in the templates and parsed files the Ansible test is never run.\r\n\r\nIt this PR is accepted and it's desired to keep the Ansible tests I would propose that the code for that is changed so that it also uses pytest. Then the Ansible tests would be run even if the other tests fail.\r\n\r\nSome tests are a bit redundant now, this is mostly to make it easier for contributors to spot what the actual error is. Another benefit of this is that it will be easier for contributors to run their own tests before they submit a PR."},"comment":{"url":"https://api.github.com/repos/networktocode/ntc-templates/issues/comments/251659939","html_url":"https://github.com/networktocode/ntc-templates/pull/5#issuecomment-251659939","issue_url":"https://api.github.com/repos/networktocode/ntc-templates/issues/5","id":251659939,"user":{"login":"GGabriele","id":4542862,"avatar_url":"https://avatars.githubusercontent.com/u/4542862?v=3","gravatar_id":"","url":"https://api.github.com/users/GGabriele","html_url":"https://github.com/GGabriele","followers_url":"https://api.github.com/users/GGabriele/followers","following_url":"https://api.github.com/users/GGabriele/following{/other_user}","gists_url":"https://api.github.com/users/GGabriele/gists{/gist_id}","starred_url":"https://api.github.com/users/GGabriele/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GGabriele/subscriptions","organizations_url":"https://api.github.com/users/GGabriele/orgs","repos_url":"https://api.github.com/users/GGabriele/repos","events_url":"https://api.github.com/users/GGabriele/events{/privacy}","received_events_url":"https://api.github.com/users/GGabriele/received_events","type":"User","site_admin":false},"created_at":"2016-10-05T12:26:56Z","updated_at":"2016-10-05T12:26:56Z","body":"Great job @ogenstad !\r\nCan you aso fix docstrings? Some of them seem to be duplicated."}}
{"actor":{"display_login":"GGabriele"}}