{"action":"created","comment":{"url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/pulls/comments/31283617","id":31283617,"diff_hunk":"@@ -85,3 +88,22 @@ def test_list_subscriptions(self):\n             main(['pubsub_sample.py', get_project_id(), 'list_subscriptions'])\n         output = out.getvalue().strip()\n         self.assertTrue(expected_sub in output)\n+\n+    def test_publish_message(self):\n+        \"\"\"Tries to publish a message and checks the output for the  message\"\"\"\n+        for message in self.messages:\n+            with captured_output() as (out, _):\n+                main(['pubsub_sample.py', get_project_id(), 'publish_message',\n+                      self.topic, message])\n+                output = out.getvalue().strip()\n+            self.assertTrue(message in output)\n+\n+    def test_pull_message(self):\n+        \"\"\"Tries to pull messages from a subscription  and checks to make sure","path":"cmdline-pull/test_pubsub_sample.py","position":45,"original_position":45,"commit_id":"0c62e2bc5fdbd66561bbe85b5aca259d9ddbbc9f","original_commit_id":"0c62e2bc5fdbd66561bbe85b5aca259d9ddbbc9f","user":{"login":"tmatsuo","id":41815,"avatar_url":"https://avatars.githubusercontent.com/u/41815?v=3","gravatar_id":"","url":"https://api.github.com/users/tmatsuo","html_url":"https://github.com/tmatsuo","followers_url":"https://api.github.com/users/tmatsuo/followers","following_url":"https://api.github.com/users/tmatsuo/following{/other_user}","gists_url":"https://api.github.com/users/tmatsuo/gists{/gist_id}","starred_url":"https://api.github.com/users/tmatsuo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tmatsuo/subscriptions","organizations_url":"https://api.github.com/users/tmatsuo/orgs","repos_url":"https://api.github.com/users/tmatsuo/repos","events_url":"https://api.github.com/users/tmatsuo/events{/privacy}","received_events_url":"https://api.github.com/users/tmatsuo/received_events","type":"User","site_admin":false},"body":"ditto","created_at":"2015-05-28T22:16:56Z","updated_at":"2015-05-28T22:16:56Z","html_url":"https://github.com/GoogleCloudPlatform/cloud-pubsub-samples-python/pull/33#discussion_r31283617","pull_request_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/pulls/33","_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/pulls/comments/31283617"},"html":{"href":"https://github.com/GoogleCloudPlatform/cloud-pubsub-samples-python/pull/33#discussion_r31283617"},"pull_request":{"href":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/pulls/33"}}},"pull_request":{"url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/pulls/33","id":36246452,"html_url":"https://github.com/GoogleCloudPlatform/cloud-pubsub-samples-python/pull/33","diff_url":"https://github.com/GoogleCloudPlatform/cloud-pubsub-samples-python/pull/33.diff","patch_url":"https://github.com/GoogleCloudPlatform/cloud-pubsub-samples-python/pull/33.patch","issue_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/issues/33","number":33,"state":"open","locked":false,"title":"Added another real test ","user":{"login":"shun-fan","id":7222445,"avatar_url":"https://avatars.githubusercontent.com/u/7222445?v=3","gravatar_id":"","url":"https://api.github.com/users/shun-fan","html_url":"https://github.com/shun-fan","followers_url":"https://api.github.com/users/shun-fan/followers","following_url":"https://api.github.com/users/shun-fan/following{/other_user}","gists_url":"https://api.github.com/users/shun-fan/gists{/gist_id}","starred_url":"https://api.github.com/users/shun-fan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shun-fan/subscriptions","organizations_url":"https://api.github.com/users/shun-fan/orgs","repos_url":"https://api.github.com/users/shun-fan/repos","events_url":"https://api.github.com/users/shun-fan/events{/privacy}","received_events_url":"https://api.github.com/users/shun-fan/received_events","type":"User","site_admin":false},"body":"Added a test for publishing and pulling messages\r\n\r\nAdded option to pubsub_sample.py to immediately terminate pull_messages requests","created_at":"2015-05-26T21:16:12Z","updated_at":"2015-05-28T22:16:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"75314f456d4b6d5879ded99da6d61ea5786f1d5b","assignee":{"login":"tmatsuo","id":41815,"avatar_url":"https://avatars.githubusercontent.com/u/41815?v=3","gravatar_id":"","url":"https://api.github.com/users/tmatsuo","html_url":"https://github.com/tmatsuo","followers_url":"https://api.github.com/users/tmatsuo/followers","following_url":"https://api.github.com/users/tmatsuo/following{/other_user}","gists_url":"https://api.github.com/users/tmatsuo/gists{/gist_id}","starred_url":"https://api.github.com/users/tmatsuo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tmatsuo/subscriptions","organizations_url":"https://api.github.com/users/tmatsuo/orgs","repos_url":"https://api.github.com/users/tmatsuo/repos","events_url":"https://api.github.com/users/tmatsuo/events{/privacy}","received_events_url":"https://api.github.com/users/tmatsuo/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/pulls/33/commits","review_comments_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/pulls/33/comments","review_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/pulls/comments{/number}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/issues/33/comments","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/statuses/0c62e2bc5fdbd66561bbe85b5aca259d9ddbbc9f","head":{"label":"GoogleCloudPlatform:tests","ref":"tests","sha":"0c62e2bc5fdbd66561bbe85b5aca259d9ddbbc9f","user":{"login":"GoogleCloudPlatform","id":2810941,"avatar_url":"https://avatars.githubusercontent.com/u/2810941?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCloudPlatform","html_url":"https://github.com/GoogleCloudPlatform","followers_url":"https://api.github.com/users/GoogleCloudPlatform/followers","following_url":"https://api.github.com/users/GoogleCloudPlatform/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCloudPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCloudPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCloudPlatform/subscriptions","organizations_url":"https://api.github.com/users/GoogleCloudPlatform/orgs","repos_url":"https://api.github.com/users/GoogleCloudPlatform/repos","events_url":"https://api.github.com/users/GoogleCloudPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCloudPlatform/received_events","type":"Organization","site_admin":false},"repo":{"id":21053045,"name":"cloud-pubsub-samples-python","full_name":"GoogleCloudPlatform/cloud-pubsub-samples-python","owner":{"login":"GoogleCloudPlatform","id":2810941,"avatar_url":"https://avatars.githubusercontent.com/u/2810941?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCloudPlatform","html_url":"https://github.com/GoogleCloudPlatform","followers_url":"https://api.github.com/users/GoogleCloudPlatform/followers","following_url":"https://api.github.com/users/GoogleCloudPlatform/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCloudPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCloudPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCloudPlatform/subscriptions","organizations_url":"https://api.github.com/users/GoogleCloudPlatform/orgs","repos_url":"https://api.github.com/users/GoogleCloudPlatform/repos","events_url":"https://api.github.com/users/GoogleCloudPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCloudPlatform/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/GoogleCloudPlatform/cloud-pubsub-samples-python","description":"Cloud Pub/Sub sample applications with Python","fork":false,"url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python","forks_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/forks","keys_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/teams","hooks_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/hooks","issue_events_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/issues/events{/number}","events_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/events","assignees_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/assignees{/user}","branches_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/branches{/branch}","tags_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/tags","blobs_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/git/refs{/sha}","trees_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/statuses/{sha}","languages_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/languages","stargazers_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/stargazers","contributors_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/contributors","subscribers_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/subscribers","subscription_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/subscription","commits_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/commits{/sha}","git_commits_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/git/commits{/sha}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/comments{/number}","issue_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/issues/comments{/number}","contents_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/contents/{+path}","compare_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/merges","archive_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/downloads","issues_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/issues{/number}","pulls_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/pulls{/number}","milestones_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/milestones{/number}","notifications_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/labels{/name}","releases_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/releases{/id}","created_at":"2014-06-20T21:30:22Z","updated_at":"2015-05-28T18:43:19Z","pushed_at":"2015-05-28T17:40:32Z","git_url":"git://github.com/GoogleCloudPlatform/cloud-pubsub-samples-python.git","ssh_url":"git@github.com:GoogleCloudPlatform/cloud-pubsub-samples-python.git","clone_url":"https://github.com/GoogleCloudPlatform/cloud-pubsub-samples-python.git","svn_url":"https://github.com/GoogleCloudPlatform/cloud-pubsub-samples-python","homepage":null,"size":721,"stargazers_count":17,"watchers_count":17,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"open_issues_count":2,"forks":9,"open_issues":2,"watchers":17,"default_branch":"master"}},"base":{"label":"GoogleCloudPlatform:master","ref":"master","sha":"22db79a781b851ebc68e03c3782bb865f09048f2","user":{"login":"GoogleCloudPlatform","id":2810941,"avatar_url":"https://avatars.githubusercontent.com/u/2810941?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCloudPlatform","html_url":"https://github.com/GoogleCloudPlatform","followers_url":"https://api.github.com/users/GoogleCloudPlatform/followers","following_url":"https://api.github.com/users/GoogleCloudPlatform/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCloudPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCloudPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCloudPlatform/subscriptions","organizations_url":"https://api.github.com/users/GoogleCloudPlatform/orgs","repos_url":"https://api.github.com/users/GoogleCloudPlatform/repos","events_url":"https://api.github.com/users/GoogleCloudPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCloudPlatform/received_events","type":"Organization","site_admin":false},"repo":{"id":21053045,"name":"cloud-pubsub-samples-python","full_name":"GoogleCloudPlatform/cloud-pubsub-samples-python","owner":{"login":"GoogleCloudPlatform","id":2810941,"avatar_url":"https://avatars.githubusercontent.com/u/2810941?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCloudPlatform","html_url":"https://github.com/GoogleCloudPlatform","followers_url":"https://api.github.com/users/GoogleCloudPlatform/followers","following_url":"https://api.github.com/users/GoogleCloudPlatform/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCloudPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCloudPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCloudPlatform/subscriptions","organizations_url":"https://api.github.com/users/GoogleCloudPlatform/orgs","repos_url":"https://api.github.com/users/GoogleCloudPlatform/repos","events_url":"https://api.github.com/users/GoogleCloudPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCloudPlatform/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/GoogleCloudPlatform/cloud-pubsub-samples-python","description":"Cloud Pub/Sub sample applications with Python","fork":false,"url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python","forks_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/forks","keys_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/teams","hooks_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/hooks","issue_events_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/issues/events{/number}","events_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/events","assignees_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/assignees{/user}","branches_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/branches{/branch}","tags_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/tags","blobs_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/git/refs{/sha}","trees_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/statuses/{sha}","languages_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/languages","stargazers_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/stargazers","contributors_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/contributors","subscribers_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/subscribers","subscription_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/subscription","commits_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/commits{/sha}","git_commits_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/git/commits{/sha}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/comments{/number}","issue_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/issues/comments{/number}","contents_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/contents/{+path}","compare_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/merges","archive_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/downloads","issues_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/issues{/number}","pulls_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/pulls{/number}","milestones_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/milestones{/number}","notifications_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/labels{/name}","releases_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/releases{/id}","created_at":"2014-06-20T21:30:22Z","updated_at":"2015-05-28T18:43:19Z","pushed_at":"2015-05-28T17:40:32Z","git_url":"git://github.com/GoogleCloudPlatform/cloud-pubsub-samples-python.git","ssh_url":"git@github.com:GoogleCloudPlatform/cloud-pubsub-samples-python.git","clone_url":"https://github.com/GoogleCloudPlatform/cloud-pubsub-samples-python.git","svn_url":"https://github.com/GoogleCloudPlatform/cloud-pubsub-samples-python","homepage":null,"size":721,"stargazers_count":17,"watchers_count":17,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"open_issues_count":2,"forks":9,"open_issues":2,"watchers":17,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/pulls/33"},"html":{"href":"https://github.com/GoogleCloudPlatform/cloud-pubsub-samples-python/pull/33"},"issue":{"href":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/issues/33"},"comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/issues/33/comments"},"review_comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/pulls/33/comments"},"review_comment":{"href":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/pulls/33/commits"},"statuses":{"href":"https://api.github.com/repos/GoogleCloudPlatform/cloud-pubsub-samples-python/statuses/0c62e2bc5fdbd66561bbe85b5aca259d9ddbbc9f"}}}}