{"action":"created","comment":{"url":"https://api.github.com/repos/ministryofjustice/postcodeinfo/pulls/comments/33025819","id":33025819,"diff_hunk":"@@ -7,15 +7,18 @@\n \n class ZipExtractorTestCase(TestCase):\n \n-  @patch('zipfile.is_zipfile', return_value=True)\n-  @patch('postcode_api.utils.ZipExtractor.unzip')\n-  def test_that_when_given_a_zip_file_it_unzips_it(self, mock_unzip, mock_zip_file):\n-    ZipExtractor('/my/test/file').unzip_if_needed('*')\n-    mock_unzip.assertCalledWith('/my/test/file')\n+    @patch('zipfile.is_zipfile', return_value=True)\n+    @patch('postcode_api.utils.ZipExtractor.unzip')","path":"postcodeinfo/apps/postcode_api/tests/test_zip_extractor.py","position":10,"original_position":10,"commit_id":"0372d7666746f249fa560cc2d8ec68887c7bfcad","original_commit_id":"0372d7666746f249fa560cc2d8ec68887c7bfcad","user":{"login":"andyhd","id":35194,"avatar_url":"https://avatars.githubusercontent.com/u/35194?v=3","gravatar_id":"","url":"https://api.github.com/users/andyhd","html_url":"https://github.com/andyhd","followers_url":"https://api.github.com/users/andyhd/followers","following_url":"https://api.github.com/users/andyhd/following{/other_user}","gists_url":"https://api.github.com/users/andyhd/gists{/gist_id}","starred_url":"https://api.github.com/users/andyhd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andyhd/subscriptions","organizations_url":"https://api.github.com/users/andyhd/orgs","repos_url":"https://api.github.com/users/andyhd/repos","events_url":"https://api.github.com/users/andyhd/events{/privacy}","received_events_url":"https://api.github.com/users/andyhd/received_events","type":"User","site_admin":false},"body":"As this patch is applied to both methods, I think it would be better in a setUp method, eg:\r\n```python\r\ndef setUp(self):\r\n    self.patch_unzip = patch('postcode_api_utils.ZipExtractor.unzip')\r\n    self.mock_unzip = patch_unzip.start()\r\n\r\ndef tearDown(self):\r\n    self.patch_unzip.stop()\r\n\r\ndef test_blah(self, mock_zip_file):\r\n    ...\r\n    self.mock_unzip.assertCalledWith(...)\r\n```","created_at":"2015-06-23T09:54:58Z","updated_at":"2015-06-23T09:54:58Z","html_url":"https://github.com/ministryofjustice/postcodeinfo/pull/51#discussion_r33025819","pull_request_url":"https://api.github.com/repos/ministryofjustice/postcodeinfo/pulls/51","_links":{"self":{"href":"https://api.github.com/repos/ministryofjustice/postcodeinfo/pulls/comments/33025819"},"html":{"href":"https://github.com/ministryofjustice/postcodeinfo/pull/51#discussion_r33025819"},"pull_request":{"href":"https://api.github.com/repos/ministryofjustice/postcodeinfo/pulls/51"}}},"pull_request":{"url":"https://api.github.com/repos/ministryofjustice/postcodeinfo/pulls/51","id":38228792,"html_url":"https://github.com/ministryofjustice/postcodeinfo/pull/51","diff_url":"https://github.com/ministryofjustice/postcodeinfo/pull/51.diff","patch_url":"https://github.com/ministryofjustice/postcodeinfo/pull/51.patch","issue_url":"https://api.github.com/repos/ministryofjustice/postcodeinfo/issues/51","number":51,"state":"open","locked":false,"title":"Added ping.json","user":{"login":"aldavidson","id":134501,"avatar_url":"https://avatars.githubusercontent.com/u/134501?v=3","gravatar_id":"","url":"https://api.github.com/users/aldavidson","html_url":"https://github.com/aldavidson","followers_url":"https://api.github.com/users/aldavidson/followers","following_url":"https://api.github.com/users/aldavidson/following{/other_user}","gists_url":"https://api.github.com/users/aldavidson/gists{/gist_id}","starred_url":"https://api.github.com/users/aldavidson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aldavidson/subscriptions","organizations_url":"https://api.github.com/users/aldavidson/orgs","repos_url":"https://api.github.com/users/aldavidson/repos","events_url":"https://api.github.com/users/aldavidson/events{/privacy}","received_events_url":"https://api.github.com/users/aldavidson/received_events","type":"User","site_admin":false},"body":"as this is required by the DS support standard","created_at":"2015-06-22T12:59:08Z","updated_at":"2015-06-23T09:54:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"303a6a1c5ab4fc685dd0a39592acf4a4e1fdcb02","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ministryofjustice/postcodeinfo/pulls/51/commits","review_comments_url":"https://api.github.com/repos/ministryofjustice/postcodeinfo/pulls/51/comments","review_comment_url":"https://api.github.com/repos/ministryofjustice/postcodeinfo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ministryofjustice/postcodeinfo/issues/51/comments","statuses_url":"https://api.github.com/repos/ministryofjustice/postcodeinfo/statuses/0372d7666746f249fa560cc2d8ec68887c7bfcad","head":{"label":"ministryofjustice:ping.json","ref":"ping.json","sha":"0372d7666746f249fa560cc2d8ec68887c7bfcad","user":{"login":"ministryofjustice","id":2203574,"avatar_url":"https://avatars.githubusercontent.com/u/2203574?v=3","gravatar_id":"","url":"https://api.github.com/users/ministryofjustice","html_url":"https://github.com/ministryofjustice","followers_url":"https://api.github.com/users/ministryofjustice/followers","following_url":"https://api.github.com/users/ministryofjustice/following{/other_user}","gists_url":"https://api.github.com/users/ministryofjustice/gists{/gist_id}","starred_url":"https://api.github.com/users/ministryofjustice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ministryofjustice/subscriptions","organizations_url":"https://api.github.com/users/ministryofjustice/orgs","repos_url":"https://api.github.com/users/ministryofjustice/repos","events_url":"https://api.github.com/users/ministryofjustice/events{/privacy}","received_events_url":"https://api.github.com/users/ministryofjustice/received_events","type":"Organization","site_admin":false},"repo":{"id":34381577,"name":"postcodeinfo","full_name":"ministryofjustice/postcodeinfo","owner":{"login":"ministryofjustice","id":2203574,"avatar_url":"https://avatars.githubusercontent.com/u/2203574?v=3","gravatar_id":"","url":"https://api.github.com/users/ministryofjustice","html_url":"https://github.com/ministryofjustice","followers_url":"https://api.github.com/users/ministryofjustice/followers","following_url":"https://api.github.com/users/ministryofjustice/following{/other_user}","gists_url":"https://api.github.com/users/ministryofjustice/gists{/gist_id}","starred_url":"https://api.github.com/users/ministryofjustice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ministryofjustice/subscriptions","organizations_url":"https://api.github.com/users/ministryofjustice/orgs","repos_url":"https://api.github.com/users/ministryofjustice/repos","events_url":"https://api.github.com/users/ministryofjustice/events{/privacy}","received_events_url":"https://api.github.com/users/ministryofjustice/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ministryofjustice/postcodeinfo","description":"REST API for looking up a given UK Postcode and getting addresses, lat/long, and local authority info","fork":false,"url":"https://api.github.com/repos/ministryofjustice/postcodeinfo","forks_url":"https://api.github.com/repos/ministryofjustice/postcodeinfo/forks","keys_url":"https://api.github.com/repos/ministryofjustice/postcodeinfo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ministryofjustice/postcodeinfo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ministryofjustice/postcodeinfo/teams","hooks_url":"https://api.github.com/repos/ministryofjustice/postcodeinfo/hooks","issue_events_url":"https://api.github.com/repos/ministryofjustice/postcodeinfo/issues/events{/number}","events_url":"https://api.github.com/repos/ministryofjustice/postcodeinfo/events","assignees_url":"https://api.github.com/repos/ministryofjustice/postcodeinfo/assignees{/user}","branches_url":"https://api.github.com/repos/ministryofjustice/postcodeinfo/branches{/branch}","tags_url":"https://api.github.com/repos/ministryofjustice/postcodeinfo/tags","blobs_url":"https://api.github.com/repos/ministryofjustice/postcodeinfo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ministryofjustice/postcodeinfo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ministryofjustice/postcodeinfo/git/refs{/sha}","trees_url":"https://api.github.com/repos/ministryofjustice/postcodeinfo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ministryofjustice/postcodeinfo/statuses/{sha}","languages_url":"https://api.github.com/repos/ministryofjustice/postcodeinfo/languages","stargazers_url":"https://api.github.com/repos/ministryofjustice/postcodeinfo/stargazers","contributors_url":"https://api.github.com/repos/ministryofjustice/postcodeinfo/contributors","subscribers_url":"https://api.github.com/repos/ministryofjustice/postcodeinfo/subscribers","subscription_url":"https://api.github.com/repos/ministryofjustice/postcodeinfo/subscription","commits_url":"https://api.github.com/repos/ministryofjustice/postcodeinfo/commits{/sha}","git_commits_url":"https://api.github.com/repos/ministryofjustice/postcodeinfo/git/commits{/sha}","comments_url":"https://api.github.com/repos/ministryofjustice/postcodeinfo/comments{/number}","issue_comment_url":"https://api.github.com/repos/ministryofjustice/postcodeinfo/issues/comments{/number}","contents_url":"https://api.github.com/repos/ministryofjustice/postcodeinfo/contents/{+path}","compare_url":"https://api.github.com/repos/ministryofjustice/postcodeinfo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ministryofjustice/postcodeinfo/merges","archive_url":"https://api.github.com/repos/ministryofjustice/postcodeinfo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ministryofjustice/postcodeinfo/downloads","issues_url":"https://api.github.com/repos/ministryofjustice/postcodeinfo/issues{/number}","pulls_url":"https://api.github.com/repos/ministryofjustice/postcodeinfo/pulls{/number}","milestones_url":"https://api.github.com/repos/ministryofjustice/postcodeinfo/milestones{/number}","notifications_url":"https://api.github.com/repos/ministryofjustice/postcodeinfo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ministryofjustice/postcodeinfo/labels{/name}","releases_url":"https://api.github.com/repos/ministryofjustice/postcodeinfo/releases{/id}","created_at":"2015-04-22T09:32:13Z","updated_at":"2015-05-14T12:17:34Z","pushed_at":"2015-06-23T09:16:28Z","git_url":"git://github.com/ministryofjustice/postcodeinfo.git","ssh_url":"git@github.com:ministryofjustice/postcodeinfo.git","clone_url":"https://github.com/ministryofjustice/postcodeinfo.git","svn_url":"https://github.com/ministryofjustice/postcodeinfo","homepage":"","size":932,"stargazers_count":1,"watchers_count":1,"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":1,"default_branch":"master"}},"base":{"label":"ministryofjustice:master","ref":"master","sha":"918a9e18e56ac2c3a83e0c31d68feee0acdb9a45","user":{"login":"ministryofjustice","id":2203574,"avatar_url":"https://avatars.githubusercontent.com/u/2203574?v=3","gravatar_id":"","url":"https://api.github.com/users/ministryofjustice","html_url":"https://github.com/ministryofjustice","followers_url":"https://api.github.com/users/ministryofjustice/followers","following_url":"https://api.github.com/users/ministryofjustice/following{/other_user}","gists_url":"https://api.github.com/users/ministryofjustice/gists{/gist_id}","starred_url":"https://api.github.com/users/ministryofjustice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ministryofjustice/subscriptions","organizations_url":"https://api.github.com/users/ministryofjustice/orgs","repos_url":"https://api.github.com/users/ministryofjustice/repos","events_url":"https://api.github.com/users/ministryofjustice/events{/privacy}","received_events_url":"https://api.github.com/users/ministryofjustice/received_events","type":"Organization","site_admin":false},"repo":{"id":34381577,"name":"postcodeinfo","full_name":"ministryofjustice/postcodeinfo","owner":{"login":"ministryofjustice","id":2203574,"avatar_url":"https://avatars.githubusercontent.com/u/2203574?v=3","gravatar_id":"","url":"https://api.github.com/users/ministryofjustice","html_url":"https://github.com/ministryofjustice","followers_url":"https://api.github.com/users/ministryofjustice/followers","following_url":"https://api.github.com/users/ministryofjustice/following{/other_user}","gists_url":"https://api.github.com/users/ministryofjustice/gists{/gist_id}","starred_url":"https://api.github.com/users/ministryofjustice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ministryofjustice/subscriptions","organizations_url":"https://api.github.com/users/ministryofjustice/orgs","repos_url":"https://api.github.com/users/ministryofjustice/repos","events_url":"https://api.github.com/users/ministryofjustice/events{/privacy}","received_events_url":"https://api.github.com/users/ministryofjustice/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ministryofjustice/postcodeinfo","description":"REST API for looking up a given UK Postcode and getting addresses, lat/long, and local authority info","fork":false,"url":"https://api.github.com/repos/ministryofjustice/postcodeinfo","forks_url":"https://api.github.com/repos/ministryofjustice/postcodeinfo/forks","keys_url":"https://api.github.com/repos/ministryofjustice/postcodeinfo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ministryofjustice/postcodeinfo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ministryofjustice/postcodeinfo/teams","hooks_url":"https://api.github.com/repos/ministryofjustice/postcodeinfo/hooks","issue_events_url":"https://api.github.com/repos/ministryofjustice/postcodeinfo/issues/events{/number}","events_url":"https://api.github.com/repos/ministryofjustice/postcodeinfo/events","assignees_url":"https://api.github.com/repos/ministryofjustice/postcodeinfo/assignees{/user}","branches_url":"https://api.github.com/repos/ministryofjustice/postcodeinfo/branches{/branch}","tags_url":"https://api.github.com/repos/ministryofjustice/postcodeinfo/tags","blobs_url":"https://api.github.com/repos/ministryofjustice/postcodeinfo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ministryofjustice/postcodeinfo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ministryofjustice/postcodeinfo/git/refs{/sha}","trees_url":"https://api.github.com/repos/ministryofjustice/postcodeinfo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ministryofjustice/postcodeinfo/statuses/{sha}","languages_url":"https://api.github.com/repos/ministryofjustice/postcodeinfo/languages","stargazers_url":"https://api.github.com/repos/ministryofjustice/postcodeinfo/stargazers","contributors_url":"https://api.github.com/repos/ministryofjustice/postcodeinfo/contributors","subscribers_url":"https://api.github.com/repos/ministryofjustice/postcodeinfo/subscribers","subscription_url":"https://api.github.com/repos/ministryofjustice/postcodeinfo/subscription","commits_url":"https://api.github.com/repos/ministryofjustice/postcodeinfo/commits{/sha}","git_commits_url":"https://api.github.com/repos/ministryofjustice/postcodeinfo/git/commits{/sha}","comments_url":"https://api.github.com/repos/ministryofjustice/postcodeinfo/comments{/number}","issue_comment_url":"https://api.github.com/repos/ministryofjustice/postcodeinfo/issues/comments{/number}","contents_url":"https://api.github.com/repos/ministryofjustice/postcodeinfo/contents/{+path}","compare_url":"https://api.github.com/repos/ministryofjustice/postcodeinfo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ministryofjustice/postcodeinfo/merges","archive_url":"https://api.github.com/repos/ministryofjustice/postcodeinfo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ministryofjustice/postcodeinfo/downloads","issues_url":"https://api.github.com/repos/ministryofjustice/postcodeinfo/issues{/number}","pulls_url":"https://api.github.com/repos/ministryofjustice/postcodeinfo/pulls{/number}","milestones_url":"https://api.github.com/repos/ministryofjustice/postcodeinfo/milestones{/number}","notifications_url":"https://api.github.com/repos/ministryofjustice/postcodeinfo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ministryofjustice/postcodeinfo/labels{/name}","releases_url":"https://api.github.com/repos/ministryofjustice/postcodeinfo/releases{/id}","created_at":"2015-04-22T09:32:13Z","updated_at":"2015-05-14T12:17:34Z","pushed_at":"2015-06-23T09:16:28Z","git_url":"git://github.com/ministryofjustice/postcodeinfo.git","ssh_url":"git@github.com:ministryofjustice/postcodeinfo.git","clone_url":"https://github.com/ministryofjustice/postcodeinfo.git","svn_url":"https://github.com/ministryofjustice/postcodeinfo","homepage":"","size":932,"stargazers_count":1,"watchers_count":1,"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":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ministryofjustice/postcodeinfo/pulls/51"},"html":{"href":"https://github.com/ministryofjustice/postcodeinfo/pull/51"},"issue":{"href":"https://api.github.com/repos/ministryofjustice/postcodeinfo/issues/51"},"comments":{"href":"https://api.github.com/repos/ministryofjustice/postcodeinfo/issues/51/comments"},"review_comments":{"href":"https://api.github.com/repos/ministryofjustice/postcodeinfo/pulls/51/comments"},"review_comment":{"href":"https://api.github.com/repos/ministryofjustice/postcodeinfo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ministryofjustice/postcodeinfo/pulls/51/commits"},"statuses":{"href":"https://api.github.com/repos/ministryofjustice/postcodeinfo/statuses/0372d7666746f249fa560cc2d8ec68887c7bfcad"}}}}