{"action":"created","comment":{"url":"https://api.github.com/repos/edx/notifications/pulls/comments/85755042","pull_request_review_id":6351533,"id":85755042,"diff_hunk":"@@ -15,20 +18,42 @@ class TestPipeline(unittest.TestCase):\n     Implements the unit tests for the notifications pipeline.\n     \"\"\"\n \n-    def test_composer(self):\n+    @patch('notifications.pipeline_manager.logging')\n+    def test_complete_pipeline(self, mock_logging):\n         message = NotificationsMessage(\"edx.notifications.forums.post.created\")\n+        pipeline = Pipeline()\n+        pipeline.process(message)\n+        # Check the vars of the message\n         self.assertIsInstance(message.uuid, UUID)\n+        self.assertEqual(len(message.history), (len(pipeline.pipeline_step_list)-1)*2)\n+        history_list = message.history\n+        for i in history_list:\n+            self.assertIsInstance(i, PipelineHistory)\n+            self.assertIsInstance(i.timestamp, datetime)\n+        # Check logging\n+        self.assertEqual(len(mock_logging.info.call_args_list), 9)  # Successful delivery means 9 calls to logging info\n+        self.assertEqual(len(mock_logging.warning.call_args_list), 0)\n \n-    def test_complete_pipeline(self):\n-        message = NotificationsMessage(\"edx.notifications.forums.post.created\")\n+    @patch('notifications.pipeline_manager.logging')\n+    def test_expiry(self, mock_logging):\n+        message = NotificationsMessage(\n+            name=\"edx.notifications.forums.post.created\",\n+            expiration_time=pytz.utc.localize(datetime.utcnow()) - timedelta(minutes=5)\n+        )\n         pipeline = Pipeline()\n+        # self.assertRaises(ValueError, pipeline.process, message)","path":"notifications/test_pipeline.py","position":45,"original_position":45,"commit_id":"47a26142b9b4ca94f101768491d457ca80f75659","original_commit_id":"47a26142b9b4ca94f101768491d457ca80f75659","user":{"login":"nasthagiri","id":6772826,"avatar_url":"https://avatars.githubusercontent.com/u/6772826?v=3","gravatar_id":"","url":"https://api.github.com/users/nasthagiri","html_url":"https://github.com/nasthagiri","followers_url":"https://api.github.com/users/nasthagiri/followers","following_url":"https://api.github.com/users/nasthagiri/following{/other_user}","gists_url":"https://api.github.com/users/nasthagiri/gists{/gist_id}","starred_url":"https://api.github.com/users/nasthagiri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nasthagiri/subscriptions","organizations_url":"https://api.github.com/users/nasthagiri/orgs","repos_url":"https://api.github.com/users/nasthagiri/repos","events_url":"https://api.github.com/users/nasthagiri/events{/privacy}","received_events_url":"https://api.github.com/users/nasthagiri/received_events","type":"User","site_admin":false},"body":"Commented out code shouldn't be merged.","created_at":"2016-10-31T14:55:41Z","updated_at":"2016-10-31T14:56:15Z","html_url":"https://github.com/edx/notifications/pull/3#discussion_r85755042","pull_request_url":"https://api.github.com/repos/edx/notifications/pulls/3","_links":{"self":{"href":"https://api.github.com/repos/edx/notifications/pulls/comments/85755042"},"html":{"href":"https://github.com/edx/notifications/pull/3#discussion_r85755042"},"pull_request":{"href":"https://api.github.com/repos/edx/notifications/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/edx/notifications/pulls/3","id":90211643,"html_url":"https://github.com/edx/notifications/pull/3","diff_url":"https://github.com/edx/notifications/pull/3.diff","patch_url":"https://github.com/edx/notifications/pull/3.patch","issue_url":"https://api.github.com/repos/edx/notifications/issues/3","number":3,"state":"open","locked":false,"title":"Added tests for logging using mock","user":{"login":"sreecharan93","id":4704071,"avatar_url":"https://avatars.githubusercontent.com/u/4704071?v=3","gravatar_id":"","url":"https://api.github.com/users/sreecharan93","html_url":"https://github.com/sreecharan93","followers_url":"https://api.github.com/users/sreecharan93/followers","following_url":"https://api.github.com/users/sreecharan93/following{/other_user}","gists_url":"https://api.github.com/users/sreecharan93/gists{/gist_id}","starred_url":"https://api.github.com/users/sreecharan93/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sreecharan93/subscriptions","organizations_url":"https://api.github.com/users/sreecharan93/orgs","repos_url":"https://api.github.com/users/sreecharan93/repos","events_url":"https://api.github.com/users/sreecharan93/events{/privacy}","received_events_url":"https://api.github.com/users/sreecharan93/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-10-20T14:28:11Z","updated_at":"2016-10-31T14:56:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9a19a33ce625ce34db79882eb80c1d0aa4cf2ec3","assignee":{"login":"jcdyer","id":77486,"avatar_url":"https://avatars.githubusercontent.com/u/77486?v=3","gravatar_id":"","url":"https://api.github.com/users/jcdyer","html_url":"https://github.com/jcdyer","followers_url":"https://api.github.com/users/jcdyer/followers","following_url":"https://api.github.com/users/jcdyer/following{/other_user}","gists_url":"https://api.github.com/users/jcdyer/gists{/gist_id}","starred_url":"https://api.github.com/users/jcdyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcdyer/subscriptions","organizations_url":"https://api.github.com/users/jcdyer/orgs","repos_url":"https://api.github.com/users/jcdyer/repos","events_url":"https://api.github.com/users/jcdyer/events{/privacy}","received_events_url":"https://api.github.com/users/jcdyer/received_events","type":"User","site_admin":false},"assignees":[{"login":"jcdyer","id":77486,"avatar_url":"https://avatars.githubusercontent.com/u/77486?v=3","gravatar_id":"","url":"https://api.github.com/users/jcdyer","html_url":"https://github.com/jcdyer","followers_url":"https://api.github.com/users/jcdyer/followers","following_url":"https://api.github.com/users/jcdyer/following{/other_user}","gists_url":"https://api.github.com/users/jcdyer/gists{/gist_id}","starred_url":"https://api.github.com/users/jcdyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcdyer/subscriptions","organizations_url":"https://api.github.com/users/jcdyer/orgs","repos_url":"https://api.github.com/users/jcdyer/repos","events_url":"https://api.github.com/users/jcdyer/events{/privacy}","received_events_url":"https://api.github.com/users/jcdyer/received_events","type":"User","site_admin":false},{"login":"nasthagiri","id":6772826,"avatar_url":"https://avatars.githubusercontent.com/u/6772826?v=3","gravatar_id":"","url":"https://api.github.com/users/nasthagiri","html_url":"https://github.com/nasthagiri","followers_url":"https://api.github.com/users/nasthagiri/followers","following_url":"https://api.github.com/users/nasthagiri/following{/other_user}","gists_url":"https://api.github.com/users/nasthagiri/gists{/gist_id}","starred_url":"https://api.github.com/users/nasthagiri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nasthagiri/subscriptions","organizations_url":"https://api.github.com/users/nasthagiri/orgs","repos_url":"https://api.github.com/users/nasthagiri/repos","events_url":"https://api.github.com/users/nasthagiri/events{/privacy}","received_events_url":"https://api.github.com/users/nasthagiri/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/edx/notifications/pulls/3/commits","review_comments_url":"https://api.github.com/repos/edx/notifications/pulls/3/comments","review_comment_url":"https://api.github.com/repos/edx/notifications/pulls/comments{/number}","comments_url":"https://api.github.com/repos/edx/notifications/issues/3/comments","statuses_url":"https://api.github.com/repos/edx/notifications/statuses/47a26142b9b4ca94f101768491d457ca80f75659","head":{"label":"edx:sree/TNL-5469","ref":"sree/TNL-5469","sha":"47a26142b9b4ca94f101768491d457ca80f75659","user":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"repo":{"id":68045431,"name":"notifications","full_name":"edx/notifications","owner":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/edx/notifications","description":"A generic notifications framework for edX.","fork":false,"url":"https://api.github.com/repos/edx/notifications","forks_url":"https://api.github.com/repos/edx/notifications/forks","keys_url":"https://api.github.com/repos/edx/notifications/keys{/key_id}","collaborators_url":"https://api.github.com/repos/edx/notifications/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/edx/notifications/teams","hooks_url":"https://api.github.com/repos/edx/notifications/hooks","issue_events_url":"https://api.github.com/repos/edx/notifications/issues/events{/number}","events_url":"https://api.github.com/repos/edx/notifications/events","assignees_url":"https://api.github.com/repos/edx/notifications/assignees{/user}","branches_url":"https://api.github.com/repos/edx/notifications/branches{/branch}","tags_url":"https://api.github.com/repos/edx/notifications/tags","blobs_url":"https://api.github.com/repos/edx/notifications/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/edx/notifications/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/edx/notifications/git/refs{/sha}","trees_url":"https://api.github.com/repos/edx/notifications/git/trees{/sha}","statuses_url":"https://api.github.com/repos/edx/notifications/statuses/{sha}","languages_url":"https://api.github.com/repos/edx/notifications/languages","stargazers_url":"https://api.github.com/repos/edx/notifications/stargazers","contributors_url":"https://api.github.com/repos/edx/notifications/contributors","subscribers_url":"https://api.github.com/repos/edx/notifications/subscribers","subscription_url":"https://api.github.com/repos/edx/notifications/subscription","commits_url":"https://api.github.com/repos/edx/notifications/commits{/sha}","git_commits_url":"https://api.github.com/repos/edx/notifications/git/commits{/sha}","comments_url":"https://api.github.com/repos/edx/notifications/comments{/number}","issue_comment_url":"https://api.github.com/repos/edx/notifications/issues/comments{/number}","contents_url":"https://api.github.com/repos/edx/notifications/contents/{+path}","compare_url":"https://api.github.com/repos/edx/notifications/compare/{base}...{head}","merges_url":"https://api.github.com/repos/edx/notifications/merges","archive_url":"https://api.github.com/repos/edx/notifications/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/edx/notifications/downloads","issues_url":"https://api.github.com/repos/edx/notifications/issues{/number}","pulls_url":"https://api.github.com/repos/edx/notifications/pulls{/number}","milestones_url":"https://api.github.com/repos/edx/notifications/milestones{/number}","notifications_url":"https://api.github.com/repos/edx/notifications/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/edx/notifications/labels{/name}","releases_url":"https://api.github.com/repos/edx/notifications/releases{/id}","deployments_url":"https://api.github.com/repos/edx/notifications/deployments","created_at":"2016-09-12T20:33:56Z","updated_at":"2016-10-17T14:04:03Z","pushed_at":"2016-10-28T18:06:14Z","git_url":"git://github.com/edx/notifications.git","ssh_url":"git@github.com:edx/notifications.git","clone_url":"https://github.com/edx/notifications.git","svn_url":"https://github.com/edx/notifications","homepage":null,"size":59,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"edx:master","ref":"master","sha":"d3cb34e8186241ac0cdbc8401c05502c175f0052","user":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"repo":{"id":68045431,"name":"notifications","full_name":"edx/notifications","owner":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/edx/notifications","description":"A generic notifications framework for edX.","fork":false,"url":"https://api.github.com/repos/edx/notifications","forks_url":"https://api.github.com/repos/edx/notifications/forks","keys_url":"https://api.github.com/repos/edx/notifications/keys{/key_id}","collaborators_url":"https://api.github.com/repos/edx/notifications/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/edx/notifications/teams","hooks_url":"https://api.github.com/repos/edx/notifications/hooks","issue_events_url":"https://api.github.com/repos/edx/notifications/issues/events{/number}","events_url":"https://api.github.com/repos/edx/notifications/events","assignees_url":"https://api.github.com/repos/edx/notifications/assignees{/user}","branches_url":"https://api.github.com/repos/edx/notifications/branches{/branch}","tags_url":"https://api.github.com/repos/edx/notifications/tags","blobs_url":"https://api.github.com/repos/edx/notifications/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/edx/notifications/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/edx/notifications/git/refs{/sha}","trees_url":"https://api.github.com/repos/edx/notifications/git/trees{/sha}","statuses_url":"https://api.github.com/repos/edx/notifications/statuses/{sha}","languages_url":"https://api.github.com/repos/edx/notifications/languages","stargazers_url":"https://api.github.com/repos/edx/notifications/stargazers","contributors_url":"https://api.github.com/repos/edx/notifications/contributors","subscribers_url":"https://api.github.com/repos/edx/notifications/subscribers","subscription_url":"https://api.github.com/repos/edx/notifications/subscription","commits_url":"https://api.github.com/repos/edx/notifications/commits{/sha}","git_commits_url":"https://api.github.com/repos/edx/notifications/git/commits{/sha}","comments_url":"https://api.github.com/repos/edx/notifications/comments{/number}","issue_comment_url":"https://api.github.com/repos/edx/notifications/issues/comments{/number}","contents_url":"https://api.github.com/repos/edx/notifications/contents/{+path}","compare_url":"https://api.github.com/repos/edx/notifications/compare/{base}...{head}","merges_url":"https://api.github.com/repos/edx/notifications/merges","archive_url":"https://api.github.com/repos/edx/notifications/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/edx/notifications/downloads","issues_url":"https://api.github.com/repos/edx/notifications/issues{/number}","pulls_url":"https://api.github.com/repos/edx/notifications/pulls{/number}","milestones_url":"https://api.github.com/repos/edx/notifications/milestones{/number}","notifications_url":"https://api.github.com/repos/edx/notifications/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/edx/notifications/labels{/name}","releases_url":"https://api.github.com/repos/edx/notifications/releases{/id}","deployments_url":"https://api.github.com/repos/edx/notifications/deployments","created_at":"2016-09-12T20:33:56Z","updated_at":"2016-10-17T14:04:03Z","pushed_at":"2016-10-28T18:06:14Z","git_url":"git://github.com/edx/notifications.git","ssh_url":"git@github.com:edx/notifications.git","clone_url":"https://github.com/edx/notifications.git","svn_url":"https://github.com/edx/notifications","homepage":null,"size":59,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/edx/notifications/pulls/3"},"html":{"href":"https://github.com/edx/notifications/pull/3"},"issue":{"href":"https://api.github.com/repos/edx/notifications/issues/3"},"comments":{"href":"https://api.github.com/repos/edx/notifications/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/edx/notifications/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/edx/notifications/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/edx/notifications/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/edx/notifications/statuses/47a26142b9b4ca94f101768491d457ca80f75659"}}}}
{"actor":{"display_login":"nasthagiri"}}