{"action":"created","comment":{"url":"https://api.github.com/repos/Cloud-CV/EvalAI/pulls/comments/356231357","pull_request_review_id":330085249,"id":356231357,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDM1NjIzMTM1Nw==","diff_hunk":"@@ -0,0 +1,44 @@\n+import mock\n+import os\n+import responses\n+import unittest\n+\n+import scripts.workers.remote_submission_worker as remote_submission_worker\n+\n+\n+class TestDownloadAndExtractFile(unittest.TestCase):\n+    def setUp(self):\n+        self.download_dir = \"/tmp/evalai/\"\n+        self.download_filename = \"file\"\n+        self.download_path = \"{}{}\".format(self.download_dir, self.download_filename)\n+\n+        self.url = \"http://example.com\"\n+        self.body = \"\"\"{\"content\": \"test-data\"}\"\"\"\n+        responses.add(\n+            responses.GET,\n+            self.url,\n+            body=self.body,\n+            status=200\n+        )\n+\n+        try:\n+            os.makedirs(self.download_dir)\n+        except OSError:\n+            pass","path":"tests/integration/worker/test_remote_submission_worker.py","position":27,"original_position":27,"commit_id":"fdef29f73f0982271161dd4b9875e50d5a41a1bc","original_commit_id":"fdef29f73f0982271161dd4b9875e50d5a41a1bc","user":{"login":"Ram81","id":16323427,"node_id":"MDQ6VXNlcjE2MzIzNDI3","avatar_url":"https://avatars2.githubusercontent.com/u/16323427?v=4","gravatar_id":"","url":"https://api.github.com/users/Ram81","html_url":"https://github.com/Ram81","followers_url":"https://api.github.com/users/Ram81/followers","following_url":"https://api.github.com/users/Ram81/following{/other_user}","gists_url":"https://api.github.com/users/Ram81/gists{/gist_id}","starred_url":"https://api.github.com/users/Ram81/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ram81/subscriptions","organizations_url":"https://api.github.com/users/Ram81/orgs","repos_url":"https://api.github.com/users/Ram81/repos","events_url":"https://api.github.com/users/Ram81/events{/privacy}","received_events_url":"https://api.github.com/users/Ram81/received_events","type":"User","site_admin":false},"body":"@takitsuse can you add a log statement here, in case directory creation fails we won't know what exactly the issue is","created_at":"2019-12-10T19:24:53Z","updated_at":"2019-12-10T19:26:08Z","html_url":"https://github.com/Cloud-CV/EvalAI/pull/2501#discussion_r356231357","pull_request_url":"https://api.github.com/repos/Cloud-CV/EvalAI/pulls/2501","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/Cloud-CV/EvalAI/pulls/comments/356231357"},"html":{"href":"https://github.com/Cloud-CV/EvalAI/pull/2501#discussion_r356231357"},"pull_request":{"href":"https://api.github.com/repos/Cloud-CV/EvalAI/pulls/2501"}}},"pull_request":{"url":"https://api.github.com/repos/Cloud-CV/EvalAI/pulls/2501","id":350585075,"node_id":"MDExOlB1bGxSZXF1ZXN0MzUwNTg1MDc1","html_url":"https://github.com/Cloud-CV/EvalAI/pull/2501","diff_url":"https://github.com/Cloud-CV/EvalAI/pull/2501.diff","patch_url":"https://github.com/Cloud-CV/EvalAI/pull/2501.patch","issue_url":"https://api.github.com/repos/Cloud-CV/EvalAI/issues/2501","number":2501,"state":"open","locked":false,"title":"Add tests for download_and_extract_file","user":{"login":"takitsuse","id":57856193,"node_id":"MDQ6VXNlcjU3ODU2MTkz","avatar_url":"https://avatars3.githubusercontent.com/u/57856193?v=4","gravatar_id":"","url":"https://api.github.com/users/takitsuse","html_url":"https://github.com/takitsuse","followers_url":"https://api.github.com/users/takitsuse/followers","following_url":"https://api.github.com/users/takitsuse/following{/other_user}","gists_url":"https://api.github.com/users/takitsuse/gists{/gist_id}","starred_url":"https://api.github.com/users/takitsuse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/takitsuse/subscriptions","organizations_url":"https://api.github.com/users/takitsuse/orgs","repos_url":"https://api.github.com/users/takitsuse/repos","events_url":"https://api.github.com/users/takitsuse/events{/privacy}","received_events_url":"https://api.github.com/users/takitsuse/received_events","type":"User","site_admin":false},"body":"## The corresponding GCI task:\r\nhttps://codein.withgoogle.com/dashboard/task-instances/6134019935174656/\r\n\r\n## Brief explanation of my changes: \r\n2 tests for [`download_and_extract_file`](https://github.com/Cloud-CV/EvalAI/blob/master/scripts/workers/remote_submission_worker.py#L99)\r\n- a test that confirms when no exception raised, the file on `download_location` is correctly written.\r\n- a test that confirms when an exception is raised, an error message is written by a logger.\r\n","created_at":"2019-12-09T08:30:17Z","updated_at":"2019-12-10T19:26:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6f80a05a64b98c23ae02f48030bc94d6199426d3","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Cloud-CV/EvalAI/pulls/2501/commits","review_comments_url":"https://api.github.com/repos/Cloud-CV/EvalAI/pulls/2501/comments","review_comment_url":"https://api.github.com/repos/Cloud-CV/EvalAI/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Cloud-CV/EvalAI/issues/2501/comments","statuses_url":"https://api.github.com/repos/Cloud-CV/EvalAI/statuses/fdef29f73f0982271161dd4b9875e50d5a41a1bc","head":{"label":"takitsuse:add-test-for-download-and-extract-file","ref":"add-test-for-download-and-extract-file","sha":"fdef29f73f0982271161dd4b9875e50d5a41a1bc","user":{"login":"takitsuse","id":57856193,"node_id":"MDQ6VXNlcjU3ODU2MTkz","avatar_url":"https://avatars3.githubusercontent.com/u/57856193?v=4","gravatar_id":"","url":"https://api.github.com/users/takitsuse","html_url":"https://github.com/takitsuse","followers_url":"https://api.github.com/users/takitsuse/followers","following_url":"https://api.github.com/users/takitsuse/following{/other_user}","gists_url":"https://api.github.com/users/takitsuse/gists{/gist_id}","starred_url":"https://api.github.com/users/takitsuse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/takitsuse/subscriptions","organizations_url":"https://api.github.com/users/takitsuse/orgs","repos_url":"https://api.github.com/users/takitsuse/repos","events_url":"https://api.github.com/users/takitsuse/events{/privacy}","received_events_url":"https://api.github.com/users/takitsuse/received_events","type":"User","site_admin":false},"repo":{"id":226017076,"node_id":"MDEwOlJlcG9zaXRvcnkyMjYwMTcwNzY=","name":"EvalAI","full_name":"takitsuse/EvalAI","private":false,"owner":{"login":"takitsuse","id":57856193,"node_id":"MDQ6VXNlcjU3ODU2MTkz","avatar_url":"https://avatars3.githubusercontent.com/u/57856193?v=4","gravatar_id":"","url":"https://api.github.com/users/takitsuse","html_url":"https://github.com/takitsuse","followers_url":"https://api.github.com/users/takitsuse/followers","following_url":"https://api.github.com/users/takitsuse/following{/other_user}","gists_url":"https://api.github.com/users/takitsuse/gists{/gist_id}","starred_url":"https://api.github.com/users/takitsuse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/takitsuse/subscriptions","organizations_url":"https://api.github.com/users/takitsuse/orgs","repos_url":"https://api.github.com/users/takitsuse/repos","events_url":"https://api.github.com/users/takitsuse/events{/privacy}","received_events_url":"https://api.github.com/users/takitsuse/received_events","type":"User","site_admin":false},"html_url":"https://github.com/takitsuse/EvalAI","description":":cloud: :rocket: :bar_chart: :chart_with_upwards_trend: Evaluating state of the art in AI","fork":true,"url":"https://api.github.com/repos/takitsuse/EvalAI","forks_url":"https://api.github.com/repos/takitsuse/EvalAI/forks","keys_url":"https://api.github.com/repos/takitsuse/EvalAI/keys{/key_id}","collaborators_url":"https://api.github.com/repos/takitsuse/EvalAI/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/takitsuse/EvalAI/teams","hooks_url":"https://api.github.com/repos/takitsuse/EvalAI/hooks","issue_events_url":"https://api.github.com/repos/takitsuse/EvalAI/issues/events{/number}","events_url":"https://api.github.com/repos/takitsuse/EvalAI/events","assignees_url":"https://api.github.com/repos/takitsuse/EvalAI/assignees{/user}","branches_url":"https://api.github.com/repos/takitsuse/EvalAI/branches{/branch}","tags_url":"https://api.github.com/repos/takitsuse/EvalAI/tags","blobs_url":"https://api.github.com/repos/takitsuse/EvalAI/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/takitsuse/EvalAI/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/takitsuse/EvalAI/git/refs{/sha}","trees_url":"https://api.github.com/repos/takitsuse/EvalAI/git/trees{/sha}","statuses_url":"https://api.github.com/repos/takitsuse/EvalAI/statuses/{sha}","languages_url":"https://api.github.com/repos/takitsuse/EvalAI/languages","stargazers_url":"https://api.github.com/repos/takitsuse/EvalAI/stargazers","contributors_url":"https://api.github.com/repos/takitsuse/EvalAI/contributors","subscribers_url":"https://api.github.com/repos/takitsuse/EvalAI/subscribers","subscription_url":"https://api.github.com/repos/takitsuse/EvalAI/subscription","commits_url":"https://api.github.com/repos/takitsuse/EvalAI/commits{/sha}","git_commits_url":"https://api.github.com/repos/takitsuse/EvalAI/git/commits{/sha}","comments_url":"https://api.github.com/repos/takitsuse/EvalAI/comments{/number}","issue_comment_url":"https://api.github.com/repos/takitsuse/EvalAI/issues/comments{/number}","contents_url":"https://api.github.com/repos/takitsuse/EvalAI/contents/{+path}","compare_url":"https://api.github.com/repos/takitsuse/EvalAI/compare/{base}...{head}","merges_url":"https://api.github.com/repos/takitsuse/EvalAI/merges","archive_url":"https://api.github.com/repos/takitsuse/EvalAI/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/takitsuse/EvalAI/downloads","issues_url":"https://api.github.com/repos/takitsuse/EvalAI/issues{/number}","pulls_url":"https://api.github.com/repos/takitsuse/EvalAI/pulls{/number}","milestones_url":"https://api.github.com/repos/takitsuse/EvalAI/milestones{/number}","notifications_url":"https://api.github.com/repos/takitsuse/EvalAI/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/takitsuse/EvalAI/labels{/name}","releases_url":"https://api.github.com/repos/takitsuse/EvalAI/releases{/id}","deployments_url":"https://api.github.com/repos/takitsuse/EvalAI/deployments","created_at":"2019-12-05T04:37:22Z","updated_at":"2019-12-05T04:37:24Z","pushed_at":"2019-12-10T02:50:52Z","git_url":"git://github.com/takitsuse/EvalAI.git","ssh_url":"git@github.com:takitsuse/EvalAI.git","clone_url":"https://github.com/takitsuse/EvalAI.git","svn_url":"https://github.com/takitsuse/EvalAI","homepage":"https://evalai.cloudcv.org/","size":43544,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Cloud-CV:master","ref":"master","sha":"d62e9e3d271561ed305f8d2a364b927a0ff344be","user":{"login":"Cloud-CV","id":20895851,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIwODk1ODUx","avatar_url":"https://avatars0.githubusercontent.com/u/20895851?v=4","gravatar_id":"","url":"https://api.github.com/users/Cloud-CV","html_url":"https://github.com/Cloud-CV","followers_url":"https://api.github.com/users/Cloud-CV/followers","following_url":"https://api.github.com/users/Cloud-CV/following{/other_user}","gists_url":"https://api.github.com/users/Cloud-CV/gists{/gist_id}","starred_url":"https://api.github.com/users/Cloud-CV/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Cloud-CV/subscriptions","organizations_url":"https://api.github.com/users/Cloud-CV/orgs","repos_url":"https://api.github.com/users/Cloud-CV/repos","events_url":"https://api.github.com/users/Cloud-CV/events{/privacy}","received_events_url":"https://api.github.com/users/Cloud-CV/received_events","type":"Organization","site_admin":false},"repo":{"id":71516397,"node_id":"MDEwOlJlcG9zaXRvcnk3MTUxNjM5Nw==","name":"EvalAI","full_name":"Cloud-CV/EvalAI","private":false,"owner":{"login":"Cloud-CV","id":20895851,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIwODk1ODUx","avatar_url":"https://avatars0.githubusercontent.com/u/20895851?v=4","gravatar_id":"","url":"https://api.github.com/users/Cloud-CV","html_url":"https://github.com/Cloud-CV","followers_url":"https://api.github.com/users/Cloud-CV/followers","following_url":"https://api.github.com/users/Cloud-CV/following{/other_user}","gists_url":"https://api.github.com/users/Cloud-CV/gists{/gist_id}","starred_url":"https://api.github.com/users/Cloud-CV/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Cloud-CV/subscriptions","organizations_url":"https://api.github.com/users/Cloud-CV/orgs","repos_url":"https://api.github.com/users/Cloud-CV/repos","events_url":"https://api.github.com/users/Cloud-CV/events{/privacy}","received_events_url":"https://api.github.com/users/Cloud-CV/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/Cloud-CV/EvalAI","description":":cloud: :rocket: :bar_chart: :chart_with_upwards_trend: Evaluating state of the art in AI","fork":false,"url":"https://api.github.com/repos/Cloud-CV/EvalAI","forks_url":"https://api.github.com/repos/Cloud-CV/EvalAI/forks","keys_url":"https://api.github.com/repos/Cloud-CV/EvalAI/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Cloud-CV/EvalAI/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Cloud-CV/EvalAI/teams","hooks_url":"https://api.github.com/repos/Cloud-CV/EvalAI/hooks","issue_events_url":"https://api.github.com/repos/Cloud-CV/EvalAI/issues/events{/number}","events_url":"https://api.github.com/repos/Cloud-CV/EvalAI/events","assignees_url":"https://api.github.com/repos/Cloud-CV/EvalAI/assignees{/user}","branches_url":"https://api.github.com/repos/Cloud-CV/EvalAI/branches{/branch}","tags_url":"https://api.github.com/repos/Cloud-CV/EvalAI/tags","blobs_url":"https://api.github.com/repos/Cloud-CV/EvalAI/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Cloud-CV/EvalAI/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Cloud-CV/EvalAI/git/refs{/sha}","trees_url":"https://api.github.com/repos/Cloud-CV/EvalAI/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Cloud-CV/EvalAI/statuses/{sha}","languages_url":"https://api.github.com/repos/Cloud-CV/EvalAI/languages","stargazers_url":"https://api.github.com/repos/Cloud-CV/EvalAI/stargazers","contributors_url":"https://api.github.com/repos/Cloud-CV/EvalAI/contributors","subscribers_url":"https://api.github.com/repos/Cloud-CV/EvalAI/subscribers","subscription_url":"https://api.github.com/repos/Cloud-CV/EvalAI/subscription","commits_url":"https://api.github.com/repos/Cloud-CV/EvalAI/commits{/sha}","git_commits_url":"https://api.github.com/repos/Cloud-CV/EvalAI/git/commits{/sha}","comments_url":"https://api.github.com/repos/Cloud-CV/EvalAI/comments{/number}","issue_comment_url":"https://api.github.com/repos/Cloud-CV/EvalAI/issues/comments{/number}","contents_url":"https://api.github.com/repos/Cloud-CV/EvalAI/contents/{+path}","compare_url":"https://api.github.com/repos/Cloud-CV/EvalAI/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Cloud-CV/EvalAI/merges","archive_url":"https://api.github.com/repos/Cloud-CV/EvalAI/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Cloud-CV/EvalAI/downloads","issues_url":"https://api.github.com/repos/Cloud-CV/EvalAI/issues{/number}","pulls_url":"https://api.github.com/repos/Cloud-CV/EvalAI/pulls{/number}","milestones_url":"https://api.github.com/repos/Cloud-CV/EvalAI/milestones{/number}","notifications_url":"https://api.github.com/repos/Cloud-CV/EvalAI/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Cloud-CV/EvalAI/labels{/name}","releases_url":"https://api.github.com/repos/Cloud-CV/EvalAI/releases{/id}","deployments_url":"https://api.github.com/repos/Cloud-CV/EvalAI/deployments","created_at":"2016-10-21T00:51:45Z","updated_at":"2019-12-09T06:57:05Z","pushed_at":"2019-12-10T18:29:55Z","git_url":"git://github.com/Cloud-CV/EvalAI.git","ssh_url":"git@github.com:Cloud-CV/EvalAI.git","clone_url":"https://github.com/Cloud-CV/EvalAI.git","svn_url":"https://github.com/Cloud-CV/EvalAI","homepage":"https://evalai.cloudcv.org/","size":43536,"stargazers_count":821,"watchers_count":821,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":408,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":68,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":408,"open_issues":68,"watchers":821,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Cloud-CV/EvalAI/pulls/2501"},"html":{"href":"https://github.com/Cloud-CV/EvalAI/pull/2501"},"issue":{"href":"https://api.github.com/repos/Cloud-CV/EvalAI/issues/2501"},"comments":{"href":"https://api.github.com/repos/Cloud-CV/EvalAI/issues/2501/comments"},"review_comments":{"href":"https://api.github.com/repos/Cloud-CV/EvalAI/pulls/2501/comments"},"review_comment":{"href":"https://api.github.com/repos/Cloud-CV/EvalAI/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Cloud-CV/EvalAI/pulls/2501/commits"},"statuses":{"href":"https://api.github.com/repos/Cloud-CV/EvalAI/statuses/fdef29f73f0982271161dd4b9875e50d5a41a1bc"}},"author_association":"NONE"}}
{"actor":{"display_login":"Ram81"}}