{"action":"created","comment":{"url":"https://api.github.com/repos/Metaswitch/python-common/pulls/comments/94373968","pull_request_review_id":14899121,"id":94373968,"diff_hunk":"@@ -32,53 +32,59 @@\n \n import unittest\n from metaswitch.common.alarms import CLEARED, CRITICAL\n-from metaswitch.common.alarms_parser import parse_alarms_file, render_alarm\n+from metaswitch.common.alarms_parser import parse_alarms_file, render_alarm, alarms_to_dita\n \n class AlarmsParserTestCase(unittest.TestCase):\n     def testValidFile(self):\n         alarms = parse_alarms_file('metaswitch/common/test/test_valid_alarms.json')\n         test_alarm = alarms[0]\n-        self.assertEqual(test_alarm[0], 'NAME', msg=\"Incorrect name.\")\n-        self.assertEqual(test_alarm[1], 1000, msg=\"Incorrect index.\")\n-        self.assertIn(CLEARED, test_alarm[2], msg=\"No cleared state.\")\n-        self.assertIn(CRITICAL, test_alarm[2], msg=\"No critical state.\")\n+        self.assertEqual(test_alarm._name, 'NAME', msg=\"Incorrect name.\")\n+        self.assertEqual(test_alarm._index, 1000, msg=\"Incorrect index.\")\n+        self.assertIn(CLEARED, test_alarm._levels.keys(), msg=\"No cleared state.\")\n+        self.assertIn(CRITICAL, test_alarm._levels.keys(), msg=\"No critical state.\")\n+        self.assertEqual(render_alarm(test_alarm), 'NAME = (1000, 1, 3)\\n')","path":"metaswitch/common/test/alarms_parser.py","position":19,"original_position":19,"commit_id":"5f4ed5f480f9ac3de8610208203e041dad72575b","original_commit_id":"5f4ed5f480f9ac3de8610208203e041dad72575b","user":{"login":"MatMeredith","id":3448274,"avatar_url":"https://avatars.githubusercontent.com/u/3448274?v=3","gravatar_id":"","url":"https://api.github.com/users/MatMeredith","html_url":"https://github.com/MatMeredith","followers_url":"https://api.github.com/users/MatMeredith/followers","following_url":"https://api.github.com/users/MatMeredith/following{/other_user}","gists_url":"https://api.github.com/users/MatMeredith/gists{/gist_id}","starred_url":"https://api.github.com/users/MatMeredith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MatMeredith/subscriptions","organizations_url":"https://api.github.com/users/MatMeredith/orgs","repos_url":"https://api.github.com/users/MatMeredith/repos","events_url":"https://api.github.com/users/MatMeredith/events{/privacy}","received_events_url":"https://api.github.com/users/MatMeredith/received_events","type":"User","site_admin":false},"body":"Yes -- this was (slightly) harder before but then I refactored the code and can easily do this now so will.","created_at":"2017-01-03T09:09:11Z","updated_at":"2017-01-03T09:09:11Z","html_url":"https://github.com/Metaswitch/python-common/pull/71#discussion_r94373968","pull_request_url":"https://api.github.com/repos/Metaswitch/python-common/pulls/71","_links":{"self":{"href":"https://api.github.com/repos/Metaswitch/python-common/pulls/comments/94373968"},"html":{"href":"https://github.com/Metaswitch/python-common/pull/71#discussion_r94373968"},"pull_request":{"href":"https://api.github.com/repos/Metaswitch/python-common/pulls/71"}}},"pull_request":{"url":"https://api.github.com/repos/Metaswitch/python-common/pulls/71","id":99241505,"html_url":"https://github.com/Metaswitch/python-common/pull/71","diff_url":"https://github.com/Metaswitch/python-common/pull/71.diff","patch_url":"https://github.com/Metaswitch/python-common/pull/71.patch","issue_url":"https://api.github.com/repos/Metaswitch/python-common/issues/71","number":71,"state":"open","locked":false,"title":"[Reviewer: Ellie] Alarms to dita","user":{"login":"MatMeredith","id":3448274,"avatar_url":"https://avatars.githubusercontent.com/u/3448274?v=3","gravatar_id":"","url":"https://api.github.com/users/MatMeredith","html_url":"https://github.com/MatMeredith","followers_url":"https://api.github.com/users/MatMeredith/followers","following_url":"https://api.github.com/users/MatMeredith/following{/other_user}","gists_url":"https://api.github.com/users/MatMeredith/gists{/gist_id}","starred_url":"https://api.github.com/users/MatMeredith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MatMeredith/subscriptions","organizations_url":"https://api.github.com/users/MatMeredith/orgs","repos_url":"https://api.github.com/users/MatMeredith/repos","events_url":"https://api.github.com/users/MatMeredith/events{/privacy}","received_events_url":"https://api.github.com/users/MatMeredith/received_events","type":"User","site_admin":false},"body":"Add support for parsing alarms files and generating a DITA document that describes them.","created_at":"2016-12-23T13:19:24Z","updated_at":"2017-01-03T09:09:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bc3caacecd988245b988b7aa80b99f782c98d0e5","assignee":{"login":"MatMeredith","id":3448274,"avatar_url":"https://avatars.githubusercontent.com/u/3448274?v=3","gravatar_id":"","url":"https://api.github.com/users/MatMeredith","html_url":"https://github.com/MatMeredith","followers_url":"https://api.github.com/users/MatMeredith/followers","following_url":"https://api.github.com/users/MatMeredith/following{/other_user}","gists_url":"https://api.github.com/users/MatMeredith/gists{/gist_id}","starred_url":"https://api.github.com/users/MatMeredith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MatMeredith/subscriptions","organizations_url":"https://api.github.com/users/MatMeredith/orgs","repos_url":"https://api.github.com/users/MatMeredith/repos","events_url":"https://api.github.com/users/MatMeredith/events{/privacy}","received_events_url":"https://api.github.com/users/MatMeredith/received_events","type":"User","site_admin":false},"assignees":[{"login":"MatMeredith","id":3448274,"avatar_url":"https://avatars.githubusercontent.com/u/3448274?v=3","gravatar_id":"","url":"https://api.github.com/users/MatMeredith","html_url":"https://github.com/MatMeredith","followers_url":"https://api.github.com/users/MatMeredith/followers","following_url":"https://api.github.com/users/MatMeredith/following{/other_user}","gists_url":"https://api.github.com/users/MatMeredith/gists{/gist_id}","starred_url":"https://api.github.com/users/MatMeredith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MatMeredith/subscriptions","organizations_url":"https://api.github.com/users/MatMeredith/orgs","repos_url":"https://api.github.com/users/MatMeredith/repos","events_url":"https://api.github.com/users/MatMeredith/events{/privacy}","received_events_url":"https://api.github.com/users/MatMeredith/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/Metaswitch/python-common/pulls/71/commits","review_comments_url":"https://api.github.com/repos/Metaswitch/python-common/pulls/71/comments","review_comment_url":"https://api.github.com/repos/Metaswitch/python-common/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Metaswitch/python-common/issues/71/comments","statuses_url":"https://api.github.com/repos/Metaswitch/python-common/statuses/5f4ed5f480f9ac3de8610208203e041dad72575b","head":{"label":"Metaswitch:alarms_to_dita","ref":"alarms_to_dita","sha":"5f4ed5f480f9ac3de8610208203e041dad72575b","user":{"login":"Metaswitch","id":453759,"avatar_url":"https://avatars.githubusercontent.com/u/453759?v=3","gravatar_id":"","url":"https://api.github.com/users/Metaswitch","html_url":"https://github.com/Metaswitch","followers_url":"https://api.github.com/users/Metaswitch/followers","following_url":"https://api.github.com/users/Metaswitch/following{/other_user}","gists_url":"https://api.github.com/users/Metaswitch/gists{/gist_id}","starred_url":"https://api.github.com/users/Metaswitch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Metaswitch/subscriptions","organizations_url":"https://api.github.com/users/Metaswitch/orgs","repos_url":"https://api.github.com/users/Metaswitch/repos","events_url":"https://api.github.com/users/Metaswitch/events{/privacy}","received_events_url":"https://api.github.com/users/Metaswitch/received_events","type":"Organization","site_admin":false},"repo":{"id":9885259,"name":"python-common","full_name":"Metaswitch/python-common","owner":{"login":"Metaswitch","id":453759,"avatar_url":"https://avatars.githubusercontent.com/u/453759?v=3","gravatar_id":"","url":"https://api.github.com/users/Metaswitch","html_url":"https://github.com/Metaswitch","followers_url":"https://api.github.com/users/Metaswitch/followers","following_url":"https://api.github.com/users/Metaswitch/following{/other_user}","gists_url":"https://api.github.com/users/Metaswitch/gists{/gist_id}","starred_url":"https://api.github.com/users/Metaswitch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Metaswitch/subscriptions","organizations_url":"https://api.github.com/users/Metaswitch/orgs","repos_url":"https://api.github.com/users/Metaswitch/repos","events_url":"https://api.github.com/users/Metaswitch/events{/privacy}","received_events_url":"https://api.github.com/users/Metaswitch/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Metaswitch/python-common","description":"Common python utilities and function library.","fork":false,"url":"https://api.github.com/repos/Metaswitch/python-common","forks_url":"https://api.github.com/repos/Metaswitch/python-common/forks","keys_url":"https://api.github.com/repos/Metaswitch/python-common/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Metaswitch/python-common/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Metaswitch/python-common/teams","hooks_url":"https://api.github.com/repos/Metaswitch/python-common/hooks","issue_events_url":"https://api.github.com/repos/Metaswitch/python-common/issues/events{/number}","events_url":"https://api.github.com/repos/Metaswitch/python-common/events","assignees_url":"https://api.github.com/repos/Metaswitch/python-common/assignees{/user}","branches_url":"https://api.github.com/repos/Metaswitch/python-common/branches{/branch}","tags_url":"https://api.github.com/repos/Metaswitch/python-common/tags","blobs_url":"https://api.github.com/repos/Metaswitch/python-common/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Metaswitch/python-common/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Metaswitch/python-common/git/refs{/sha}","trees_url":"https://api.github.com/repos/Metaswitch/python-common/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Metaswitch/python-common/statuses/{sha}","languages_url":"https://api.github.com/repos/Metaswitch/python-common/languages","stargazers_url":"https://api.github.com/repos/Metaswitch/python-common/stargazers","contributors_url":"https://api.github.com/repos/Metaswitch/python-common/contributors","subscribers_url":"https://api.github.com/repos/Metaswitch/python-common/subscribers","subscription_url":"https://api.github.com/repos/Metaswitch/python-common/subscription","commits_url":"https://api.github.com/repos/Metaswitch/python-common/commits{/sha}","git_commits_url":"https://api.github.com/repos/Metaswitch/python-common/git/commits{/sha}","comments_url":"https://api.github.com/repos/Metaswitch/python-common/comments{/number}","issue_comment_url":"https://api.github.com/repos/Metaswitch/python-common/issues/comments{/number}","contents_url":"https://api.github.com/repos/Metaswitch/python-common/contents/{+path}","compare_url":"https://api.github.com/repos/Metaswitch/python-common/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Metaswitch/python-common/merges","archive_url":"https://api.github.com/repos/Metaswitch/python-common/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Metaswitch/python-common/downloads","issues_url":"https://api.github.com/repos/Metaswitch/python-common/issues{/number}","pulls_url":"https://api.github.com/repos/Metaswitch/python-common/pulls{/number}","milestones_url":"https://api.github.com/repos/Metaswitch/python-common/milestones{/number}","notifications_url":"https://api.github.com/repos/Metaswitch/python-common/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Metaswitch/python-common/labels{/name}","releases_url":"https://api.github.com/repos/Metaswitch/python-common/releases{/id}","deployments_url":"https://api.github.com/repos/Metaswitch/python-common/deployments","created_at":"2013-05-06T11:20:46Z","updated_at":"2016-10-24T16:43:09Z","pushed_at":"2016-12-23T13:19:25Z","git_url":"git://github.com/Metaswitch/python-common.git","ssh_url":"git@github.com:Metaswitch/python-common.git","clone_url":"https://github.com/Metaswitch/python-common.git","svn_url":"https://github.com/Metaswitch/python-common","homepage":null,"size":195,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":2,"forks":4,"open_issues":2,"watchers":1,"default_branch":"dev"}},"base":{"label":"Metaswitch:dev","ref":"dev","sha":"76926ad5210e812741f2b62c2d6814495d6c14f5","user":{"login":"Metaswitch","id":453759,"avatar_url":"https://avatars.githubusercontent.com/u/453759?v=3","gravatar_id":"","url":"https://api.github.com/users/Metaswitch","html_url":"https://github.com/Metaswitch","followers_url":"https://api.github.com/users/Metaswitch/followers","following_url":"https://api.github.com/users/Metaswitch/following{/other_user}","gists_url":"https://api.github.com/users/Metaswitch/gists{/gist_id}","starred_url":"https://api.github.com/users/Metaswitch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Metaswitch/subscriptions","organizations_url":"https://api.github.com/users/Metaswitch/orgs","repos_url":"https://api.github.com/users/Metaswitch/repos","events_url":"https://api.github.com/users/Metaswitch/events{/privacy}","received_events_url":"https://api.github.com/users/Metaswitch/received_events","type":"Organization","site_admin":false},"repo":{"id":9885259,"name":"python-common","full_name":"Metaswitch/python-common","owner":{"login":"Metaswitch","id":453759,"avatar_url":"https://avatars.githubusercontent.com/u/453759?v=3","gravatar_id":"","url":"https://api.github.com/users/Metaswitch","html_url":"https://github.com/Metaswitch","followers_url":"https://api.github.com/users/Metaswitch/followers","following_url":"https://api.github.com/users/Metaswitch/following{/other_user}","gists_url":"https://api.github.com/users/Metaswitch/gists{/gist_id}","starred_url":"https://api.github.com/users/Metaswitch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Metaswitch/subscriptions","organizations_url":"https://api.github.com/users/Metaswitch/orgs","repos_url":"https://api.github.com/users/Metaswitch/repos","events_url":"https://api.github.com/users/Metaswitch/events{/privacy}","received_events_url":"https://api.github.com/users/Metaswitch/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Metaswitch/python-common","description":"Common python utilities and function library.","fork":false,"url":"https://api.github.com/repos/Metaswitch/python-common","forks_url":"https://api.github.com/repos/Metaswitch/python-common/forks","keys_url":"https://api.github.com/repos/Metaswitch/python-common/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Metaswitch/python-common/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Metaswitch/python-common/teams","hooks_url":"https://api.github.com/repos/Metaswitch/python-common/hooks","issue_events_url":"https://api.github.com/repos/Metaswitch/python-common/issues/events{/number}","events_url":"https://api.github.com/repos/Metaswitch/python-common/events","assignees_url":"https://api.github.com/repos/Metaswitch/python-common/assignees{/user}","branches_url":"https://api.github.com/repos/Metaswitch/python-common/branches{/branch}","tags_url":"https://api.github.com/repos/Metaswitch/python-common/tags","blobs_url":"https://api.github.com/repos/Metaswitch/python-common/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Metaswitch/python-common/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Metaswitch/python-common/git/refs{/sha}","trees_url":"https://api.github.com/repos/Metaswitch/python-common/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Metaswitch/python-common/statuses/{sha}","languages_url":"https://api.github.com/repos/Metaswitch/python-common/languages","stargazers_url":"https://api.github.com/repos/Metaswitch/python-common/stargazers","contributors_url":"https://api.github.com/repos/Metaswitch/python-common/contributors","subscribers_url":"https://api.github.com/repos/Metaswitch/python-common/subscribers","subscription_url":"https://api.github.com/repos/Metaswitch/python-common/subscription","commits_url":"https://api.github.com/repos/Metaswitch/python-common/commits{/sha}","git_commits_url":"https://api.github.com/repos/Metaswitch/python-common/git/commits{/sha}","comments_url":"https://api.github.com/repos/Metaswitch/python-common/comments{/number}","issue_comment_url":"https://api.github.com/repos/Metaswitch/python-common/issues/comments{/number}","contents_url":"https://api.github.com/repos/Metaswitch/python-common/contents/{+path}","compare_url":"https://api.github.com/repos/Metaswitch/python-common/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Metaswitch/python-common/merges","archive_url":"https://api.github.com/repos/Metaswitch/python-common/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Metaswitch/python-common/downloads","issues_url":"https://api.github.com/repos/Metaswitch/python-common/issues{/number}","pulls_url":"https://api.github.com/repos/Metaswitch/python-common/pulls{/number}","milestones_url":"https://api.github.com/repos/Metaswitch/python-common/milestones{/number}","notifications_url":"https://api.github.com/repos/Metaswitch/python-common/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Metaswitch/python-common/labels{/name}","releases_url":"https://api.github.com/repos/Metaswitch/python-common/releases{/id}","deployments_url":"https://api.github.com/repos/Metaswitch/python-common/deployments","created_at":"2013-05-06T11:20:46Z","updated_at":"2016-10-24T16:43:09Z","pushed_at":"2016-12-23T13:19:25Z","git_url":"git://github.com/Metaswitch/python-common.git","ssh_url":"git@github.com:Metaswitch/python-common.git","clone_url":"https://github.com/Metaswitch/python-common.git","svn_url":"https://github.com/Metaswitch/python-common","homepage":null,"size":195,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":2,"forks":4,"open_issues":2,"watchers":1,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/Metaswitch/python-common/pulls/71"},"html":{"href":"https://github.com/Metaswitch/python-common/pull/71"},"issue":{"href":"https://api.github.com/repos/Metaswitch/python-common/issues/71"},"comments":{"href":"https://api.github.com/repos/Metaswitch/python-common/issues/71/comments"},"review_comments":{"href":"https://api.github.com/repos/Metaswitch/python-common/pulls/71/comments"},"review_comment":{"href":"https://api.github.com/repos/Metaswitch/python-common/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Metaswitch/python-common/pulls/71/commits"},"statuses":{"href":"https://api.github.com/repos/Metaswitch/python-common/statuses/5f4ed5f480f9ac3de8610208203e041dad72575b"}}}}
{"actor":{"display_login":"MatMeredith"}}