{"action":"created","comment":{"url":"https://api.github.com/repos/Metaswitch/clearwater-etcd/pulls/comments/78024636","id":78024636,"diff_hunk":"@@ -0,0 +1,63 @@\n+# @file test_chronos_gr_config_plugin.py\n+#\n+# Project Clearwater - IMS in the Cloud\n+# Copyright (C) 2016 Metaswitch Networks Ltd\n+#\n+# This program is free software: you can redistribute it and/or modify it\n+# under the terms of the GNU General Public License as published by the\n+# Free Software Foundation, either version 3 of the License, or (at your\n+# option) any later version, along with the \"Special Exception\" for use of\n+# the program along with SSL, set forth below. This program is distributed\n+# in the hope that it will be useful, but WITHOUT ANY WARRANTY;\n+# without even the implied warranty of MERCHANTABILITY or FITNESS FOR\n+# A PARTICULAR PURPOSE.  See the GNU General Public License for more\n+# details. You should have received a copy of the GNU General Public\n+# License along with this program.  If not, see\n+# <http://www.gnu.org/licenses/>.\n+#\n+# The author can be reached by email at clearwater@metaswitch.com or by\n+# post at Metaswitch Networks Ltd, 100 Church St, Enfield EN2 6BQ, UK\n+#\n+# Special Exception\n+# Metaswitch Networks Ltd  grants you permission to copy, modify,\n+# propagate, and distribute a work formed by combining OpenSSL with The\n+# Software, or a work derivative of such a combination, even if such\n+# copying, modification, propagation, or distribution would otherwise\n+# violate the terms of the GPL. You must comply with the GPL in all\n+# respects for all of the code used other than OpenSSL.\n+# \"OpenSSL\" means OpenSSL toolkit software distributed by the OpenSSL\n+# Project and licensed under the OpenSSL Licenses, or a work based on such\n+# software and licensed under the OpenSSL Licenses.\n+# \"OpenSSL Licenses\" means the OpenSSL License and Original SSLeay License\n+# under which the OpenSSL Project distributes the OpenSSL toolkit software,\n+# as those licenses appear in the file LICENSE-OPENSSL.\n+\n+import unittest\n+import mock\n+import logging\n+\n+_log = logging.getLogger()\n+\n+from clearwater_etcd_plugins.chronos.chronos_gr_config_plugin import ChronosGRConfigPlugin\n+\n+class TestConfigManagerPlugin(unittest.TestCase):\n+    @mock.patch('clearwater_etcd_plugins.chronos.chronos_gr_config_plugin.safely_write')\n+    @mock.patch('clearwater_etcd_plugins.chronos.chronos_gr_config_plugin.run_command')\n+    def test_chronos_gr_config_changed(self, mock_run_command, mock_safely_write):\n+        \"\"\"Test Chronos GR Config plugin writes new config when config has changed\"\"\"\n+\n+        # Create the plugin\n+        plugin = ChronosGRConfigPlugin({})\n+\n+        # Set up the config strings to be tested\n+        old_config_string = \"Old Chronos GR config\"\n+        new_config_string = \"New Chronos GR config\"\n+\n+        # Call 'on_config_changed' with file.open mocked out\n+        with mock.patch('clearwater_etcd_plugins.chronos.chronos_gr_config_plugin.open', mock.mock_open(read_data=old_config_string), create=True) as mock_open:","path":"src/metaswitch/clearwater/plugin_tests/test_chronos_gr_config_plugin.py","position":57,"original_position":57,"commit_id":"c76c61138034ee0b133a27ef6a237070ab1e44bd","original_commit_id":"c76c61138034ee0b133a27ef6a237070ab1e44bd","user":{"login":"richardwhiuk","id":346165,"avatar_url":"https://avatars.githubusercontent.com/u/346165?v=3","gravatar_id":"","url":"https://api.github.com/users/richardwhiuk","html_url":"https://github.com/richardwhiuk","followers_url":"https://api.github.com/users/richardwhiuk/followers","following_url":"https://api.github.com/users/richardwhiuk/following{/other_user}","gists_url":"https://api.github.com/users/richardwhiuk/gists{/gist_id}","starred_url":"https://api.github.com/users/richardwhiuk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/richardwhiuk/subscriptions","organizations_url":"https://api.github.com/users/richardwhiuk/orgs","repos_url":"https://api.github.com/users/richardwhiuk/repos","events_url":"https://api.github.com/users/richardwhiuk/events{/privacy}","received_events_url":"https://api.github.com/users/richardwhiuk/received_events","type":"User","site_admin":false},"body":"This line is quite long.","created_at":"2016-09-08T15:03:48Z","updated_at":"2016-09-08T15:03:48Z","html_url":"https://github.com/Metaswitch/clearwater-etcd/pull/316#discussion_r78024636","pull_request_url":"https://api.github.com/repos/Metaswitch/clearwater-etcd/pulls/316","_links":{"self":{"href":"https://api.github.com/repos/Metaswitch/clearwater-etcd/pulls/comments/78024636"},"html":{"href":"https://github.com/Metaswitch/clearwater-etcd/pull/316#discussion_r78024636"},"pull_request":{"href":"https://api.github.com/repos/Metaswitch/clearwater-etcd/pulls/316"}}},"pull_request":{"url":"https://api.github.com/repos/Metaswitch/clearwater-etcd/pulls/316","id":84465059,"html_url":"https://github.com/Metaswitch/clearwater-etcd/pull/316","diff_url":"https://github.com/Metaswitch/clearwater-etcd/pull/316.diff","patch_url":"https://github.com/Metaswitch/clearwater-etcd/pull/316.patch","issue_url":"https://api.github.com/repos/Metaswitch/clearwater-etcd/issues/316","number":316,"state":"open","locked":false,"title":"[Reviewer: Richard] Add UTs for Chronos config plugins","user":{"login":"eleanor-merry","id":5425325,"avatar_url":"https://avatars.githubusercontent.com/u/5425325?v=3","gravatar_id":"","url":"https://api.github.com/users/eleanor-merry","html_url":"https://github.com/eleanor-merry","followers_url":"https://api.github.com/users/eleanor-merry/followers","following_url":"https://api.github.com/users/eleanor-merry/following{/other_user}","gists_url":"https://api.github.com/users/eleanor-merry/gists{/gist_id}","starred_url":"https://api.github.com/users/eleanor-merry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eleanor-merry/subscriptions","organizations_url":"https://api.github.com/users/eleanor-merry/orgs","repos_url":"https://api.github.com/users/eleanor-merry/repos","events_url":"https://api.github.com/users/eleanor-merry/events{/privacy}","received_events_url":"https://api.github.com/users/eleanor-merry/received_events","type":"User","site_admin":false},"body":"These are the UTs and alarm text for https://github.com/Metaswitch/clearwater-etcd-plugins/pull/8","created_at":"2016-09-08T12:07:20Z","updated_at":"2016-09-08T15:03:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c30b2c340b6fbef8135f578c784601c3228ea73c","assignee":{"login":"richardwhiuk","id":346165,"avatar_url":"https://avatars.githubusercontent.com/u/346165?v=3","gravatar_id":"","url":"https://api.github.com/users/richardwhiuk","html_url":"https://github.com/richardwhiuk","followers_url":"https://api.github.com/users/richardwhiuk/followers","following_url":"https://api.github.com/users/richardwhiuk/following{/other_user}","gists_url":"https://api.github.com/users/richardwhiuk/gists{/gist_id}","starred_url":"https://api.github.com/users/richardwhiuk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/richardwhiuk/subscriptions","organizations_url":"https://api.github.com/users/richardwhiuk/orgs","repos_url":"https://api.github.com/users/richardwhiuk/repos","events_url":"https://api.github.com/users/richardwhiuk/events{/privacy}","received_events_url":"https://api.github.com/users/richardwhiuk/received_events","type":"User","site_admin":false},"assignees":[{"login":"richardwhiuk","id":346165,"avatar_url":"https://avatars.githubusercontent.com/u/346165?v=3","gravatar_id":"","url":"https://api.github.com/users/richardwhiuk","html_url":"https://github.com/richardwhiuk","followers_url":"https://api.github.com/users/richardwhiuk/followers","following_url":"https://api.github.com/users/richardwhiuk/following{/other_user}","gists_url":"https://api.github.com/users/richardwhiuk/gists{/gist_id}","starred_url":"https://api.github.com/users/richardwhiuk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/richardwhiuk/subscriptions","organizations_url":"https://api.github.com/users/richardwhiuk/orgs","repos_url":"https://api.github.com/users/richardwhiuk/repos","events_url":"https://api.github.com/users/richardwhiuk/events{/privacy}","received_events_url":"https://api.github.com/users/richardwhiuk/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/Metaswitch/clearwater-etcd/pulls/316/commits","review_comments_url":"https://api.github.com/repos/Metaswitch/clearwater-etcd/pulls/316/comments","review_comment_url":"https://api.github.com/repos/Metaswitch/clearwater-etcd/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Metaswitch/clearwater-etcd/issues/316/comments","statuses_url":"https://api.github.com/repos/Metaswitch/clearwater-etcd/statuses/c76c61138034ee0b133a27ef6a237070ab1e44bd","head":{"label":"Metaswitch:chronos_config_plugins","ref":"chronos_config_plugins","sha":"c76c61138034ee0b133a27ef6a237070ab1e44bd","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":34358654,"name":"clearwater-etcd","full_name":"Metaswitch/clearwater-etcd","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/clearwater-etcd","description":"Wrappers around etcd for ease of integration into Project Clearwater","fork":false,"url":"https://api.github.com/repos/Metaswitch/clearwater-etcd","forks_url":"https://api.github.com/repos/Metaswitch/clearwater-etcd/forks","keys_url":"https://api.github.com/repos/Metaswitch/clearwater-etcd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Metaswitch/clearwater-etcd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Metaswitch/clearwater-etcd/teams","hooks_url":"https://api.github.com/repos/Metaswitch/clearwater-etcd/hooks","issue_events_url":"https://api.github.com/repos/Metaswitch/clearwater-etcd/issues/events{/number}","events_url":"https://api.github.com/repos/Metaswitch/clearwater-etcd/events","assignees_url":"https://api.github.com/repos/Metaswitch/clearwater-etcd/assignees{/user}","branches_url":"https://api.github.com/repos/Metaswitch/clearwater-etcd/branches{/branch}","tags_url":"https://api.github.com/repos/Metaswitch/clearwater-etcd/tags","blobs_url":"https://api.github.com/repos/Metaswitch/clearwater-etcd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Metaswitch/clearwater-etcd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Metaswitch/clearwater-etcd/git/refs{/sha}","trees_url":"https://api.github.com/repos/Metaswitch/clearwater-etcd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Metaswitch/clearwater-etcd/statuses/{sha}","languages_url":"https://api.github.com/repos/Metaswitch/clearwater-etcd/languages","stargazers_url":"https://api.github.com/repos/Metaswitch/clearwater-etcd/stargazers","contributors_url":"https://api.github.com/repos/Metaswitch/clearwater-etcd/contributors","subscribers_url":"https://api.github.com/repos/Metaswitch/clearwater-etcd/subscribers","subscription_url":"https://api.github.com/repos/Metaswitch/clearwater-etcd/subscription","commits_url":"https://api.github.com/repos/Metaswitch/clearwater-etcd/commits{/sha}","git_commits_url":"https://api.github.com/repos/Metaswitch/clearwater-etcd/git/commits{/sha}","comments_url":"https://api.github.com/repos/Metaswitch/clearwater-etcd/comments{/number}","issue_comment_url":"https://api.github.com/repos/Metaswitch/clearwater-etcd/issues/comments{/number}","contents_url":"https://api.github.com/repos/Metaswitch/clearwater-etcd/contents/{+path}","compare_url":"https://api.github.com/repos/Metaswitch/clearwater-etcd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Metaswitch/clearwater-etcd/merges","archive_url":"https://api.github.com/repos/Metaswitch/clearwater-etcd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Metaswitch/clearwater-etcd/downloads","issues_url":"https://api.github.com/repos/Metaswitch/clearwater-etcd/issues{/number}","pulls_url":"https://api.github.com/repos/Metaswitch/clearwater-etcd/pulls{/number}","milestones_url":"https://api.github.com/repos/Metaswitch/clearwater-etcd/milestones{/number}","notifications_url":"https://api.github.com/repos/Metaswitch/clearwater-etcd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Metaswitch/clearwater-etcd/labels{/name}","releases_url":"https://api.github.com/repos/Metaswitch/clearwater-etcd/releases{/id}","deployments_url":"https://api.github.com/repos/Metaswitch/clearwater-etcd/deployments","created_at":"2015-04-22T00:03:08Z","updated_at":"2016-08-07T17:21:58Z","pushed_at":"2016-09-08T14:59:19Z","git_url":"git://github.com/Metaswitch/clearwater-etcd.git","ssh_url":"git@github.com:Metaswitch/clearwater-etcd.git","clone_url":"https://github.com/Metaswitch/clearwater-etcd.git","svn_url":"https://github.com/Metaswitch/clearwater-etcd","homepage":null,"size":27231,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":15,"forks":2,"open_issues":15,"watchers":1,"default_branch":"dev"}},"base":{"label":"Metaswitch:dev","ref":"dev","sha":"c3488f214214f1db4ec9b32bf7105911ad57851f","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":34358654,"name":"clearwater-etcd","full_name":"Metaswitch/clearwater-etcd","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/clearwater-etcd","description":"Wrappers around etcd for ease of integration into Project Clearwater","fork":false,"url":"https://api.github.com/repos/Metaswitch/clearwater-etcd","forks_url":"https://api.github.com/repos/Metaswitch/clearwater-etcd/forks","keys_url":"https://api.github.com/repos/Metaswitch/clearwater-etcd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Metaswitch/clearwater-etcd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Metaswitch/clearwater-etcd/teams","hooks_url":"https://api.github.com/repos/Metaswitch/clearwater-etcd/hooks","issue_events_url":"https://api.github.com/repos/Metaswitch/clearwater-etcd/issues/events{/number}","events_url":"https://api.github.com/repos/Metaswitch/clearwater-etcd/events","assignees_url":"https://api.github.com/repos/Metaswitch/clearwater-etcd/assignees{/user}","branches_url":"https://api.github.com/repos/Metaswitch/clearwater-etcd/branches{/branch}","tags_url":"https://api.github.com/repos/Metaswitch/clearwater-etcd/tags","blobs_url":"https://api.github.com/repos/Metaswitch/clearwater-etcd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Metaswitch/clearwater-etcd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Metaswitch/clearwater-etcd/git/refs{/sha}","trees_url":"https://api.github.com/repos/Metaswitch/clearwater-etcd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Metaswitch/clearwater-etcd/statuses/{sha}","languages_url":"https://api.github.com/repos/Metaswitch/clearwater-etcd/languages","stargazers_url":"https://api.github.com/repos/Metaswitch/clearwater-etcd/stargazers","contributors_url":"https://api.github.com/repos/Metaswitch/clearwater-etcd/contributors","subscribers_url":"https://api.github.com/repos/Metaswitch/clearwater-etcd/subscribers","subscription_url":"https://api.github.com/repos/Metaswitch/clearwater-etcd/subscription","commits_url":"https://api.github.com/repos/Metaswitch/clearwater-etcd/commits{/sha}","git_commits_url":"https://api.github.com/repos/Metaswitch/clearwater-etcd/git/commits{/sha}","comments_url":"https://api.github.com/repos/Metaswitch/clearwater-etcd/comments{/number}","issue_comment_url":"https://api.github.com/repos/Metaswitch/clearwater-etcd/issues/comments{/number}","contents_url":"https://api.github.com/repos/Metaswitch/clearwater-etcd/contents/{+path}","compare_url":"https://api.github.com/repos/Metaswitch/clearwater-etcd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Metaswitch/clearwater-etcd/merges","archive_url":"https://api.github.com/repos/Metaswitch/clearwater-etcd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Metaswitch/clearwater-etcd/downloads","issues_url":"https://api.github.com/repos/Metaswitch/clearwater-etcd/issues{/number}","pulls_url":"https://api.github.com/repos/Metaswitch/clearwater-etcd/pulls{/number}","milestones_url":"https://api.github.com/repos/Metaswitch/clearwater-etcd/milestones{/number}","notifications_url":"https://api.github.com/repos/Metaswitch/clearwater-etcd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Metaswitch/clearwater-etcd/labels{/name}","releases_url":"https://api.github.com/repos/Metaswitch/clearwater-etcd/releases{/id}","deployments_url":"https://api.github.com/repos/Metaswitch/clearwater-etcd/deployments","created_at":"2015-04-22T00:03:08Z","updated_at":"2016-08-07T17:21:58Z","pushed_at":"2016-09-08T14:59:19Z","git_url":"git://github.com/Metaswitch/clearwater-etcd.git","ssh_url":"git@github.com:Metaswitch/clearwater-etcd.git","clone_url":"https://github.com/Metaswitch/clearwater-etcd.git","svn_url":"https://github.com/Metaswitch/clearwater-etcd","homepage":null,"size":27231,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":15,"forks":2,"open_issues":15,"watchers":1,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/Metaswitch/clearwater-etcd/pulls/316"},"html":{"href":"https://github.com/Metaswitch/clearwater-etcd/pull/316"},"issue":{"href":"https://api.github.com/repos/Metaswitch/clearwater-etcd/issues/316"},"comments":{"href":"https://api.github.com/repos/Metaswitch/clearwater-etcd/issues/316/comments"},"review_comments":{"href":"https://api.github.com/repos/Metaswitch/clearwater-etcd/pulls/316/comments"},"review_comment":{"href":"https://api.github.com/repos/Metaswitch/clearwater-etcd/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Metaswitch/clearwater-etcd/pulls/316/commits"},"statuses":{"href":"https://api.github.com/repos/Metaswitch/clearwater-etcd/statuses/c76c61138034ee0b133a27ef6a237070ab1e44bd"}}}}
{"actor":{"display_login":"richardwhiuk"}}