{"action":"created","comment":{"url":"https://api.github.com/repos/firebase/firebase-admin-python/pulls/comments/235217520","pull_request_review_id":177033082,"id":235217520,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzNTIxNzUyMA==","diff_hunk":"@@ -121,19 +121,35 @@ def get_credential(self):\n         return self._g_credential\n \n \n-class MockAdapter(adapters.HTTPAdapter):\n-    \"\"\"A mock HTTP adapter for the Python requests module.\"\"\"\n-    def __init__(self, data, status, recorder):\n+class MockMultiRequestAdapter(adapters.HTTPAdapter):\n+    \"\"\"A mock HTTP adapter that supports multiple responses for the Python requests module.\"\"\"\n+    def __init__(self, responses, statuses, recorder):\n+        \"\"\"Constructs a MockMultiRequestAdapter.\n+\n+        The lengths of the responses and statuses parameters must match.\n+\n+        Each incoming request consumes a response and a status, in order. If all responses and\n+        statuses are exhausted, further requests will reuse the last response and status.\n+        \"\"\"\n         adapters.HTTPAdapter.__init__(self)\n-        self._data = data\n-        self._status = status\n+        assert len(responses) == len(statuses)","path":"tests/testutils.py","position":20,"original_position":20,"commit_id":"9ab187c74fb33a6ec29cb5e101034e4fa52a40af","original_commit_id":"9ab187c74fb33a6ec29cb5e101034e4fa52a40af","user":{"login":"hiranya911","id":2375201,"node_id":"MDQ6VXNlcjIzNzUyMDE=","avatar_url":"https://avatars1.githubusercontent.com/u/2375201?v=4","gravatar_id":"","url":"https://api.github.com/users/hiranya911","html_url":"https://github.com/hiranya911","followers_url":"https://api.github.com/users/hiranya911/followers","following_url":"https://api.github.com/users/hiranya911/following{/other_user}","gists_url":"https://api.github.com/users/hiranya911/gists{/gist_id}","starred_url":"https://api.github.com/users/hiranya911/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hiranya911/subscriptions","organizations_url":"https://api.github.com/users/hiranya911/orgs","repos_url":"https://api.github.com/users/hiranya911/repos","events_url":"https://api.github.com/users/hiranya911/events{/privacy}","received_events_url":"https://api.github.com/users/hiranya911/received_events","type":"User","site_admin":false},"body":"Throw a ValueError here. We only do asserts inside test cases.","created_at":"2018-11-21T00:25:09Z","updated_at":"2018-11-21T00:35:29Z","html_url":"https://github.com/firebase/firebase-admin-python/pull/218#discussion_r235217520","pull_request_url":"https://api.github.com/repos/firebase/firebase-admin-python/pulls/218","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/firebase/firebase-admin-python/pulls/comments/235217520"},"html":{"href":"https://github.com/firebase/firebase-admin-python/pull/218#discussion_r235217520"},"pull_request":{"href":"https://api.github.com/repos/firebase/firebase-admin-python/pulls/218"}}},"pull_request":{"url":"https://api.github.com/repos/firebase/firebase-admin-python/pulls/218","id":229572167,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI5NTcyMTY3","html_url":"https://github.com/firebase/firebase-admin-python/pull/218","diff_url":"https://github.com/firebase/firebase-admin-python/pull/218.diff","patch_url":"https://github.com/firebase/firebase-admin-python/pull/218.patch","issue_url":"https://api.github.com/repos/firebase/firebase-admin-python/issues/218","number":218,"state":"open","locked":false,"title":"Add an (incomplete) unit test for package_management; add a MockMultiRequestAdapter test utility","user":{"login":"weixifan","id":44070836,"node_id":"MDQ6VXNlcjQ0MDcwODM2","avatar_url":"https://avatars1.githubusercontent.com/u/44070836?v=4","gravatar_id":"","url":"https://api.github.com/users/weixifan","html_url":"https://github.com/weixifan","followers_url":"https://api.github.com/users/weixifan/followers","following_url":"https://api.github.com/users/weixifan/following{/other_user}","gists_url":"https://api.github.com/users/weixifan/gists{/gist_id}","starred_url":"https://api.github.com/users/weixifan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weixifan/subscriptions","organizations_url":"https://api.github.com/users/weixifan/orgs","repos_url":"https://api.github.com/users/weixifan/repos","events_url":"https://api.github.com/users/weixifan/events{/privacy}","received_events_url":"https://api.github.com/users/weixifan/received_events","type":"User","site_admin":false},"body":"Feedback on the layout of the unit test as well as the `MockMultiRequestAdapter` is welcome. Note that I will make the test parameterized in a later PR so that it can be used for iOS as well.\r\n\r\nEdit: Actually, I just tried to make the tests parameterized; however, there are just enough parameters per test to make the resulting test a lot less readable than it is now. There are simply too many parameters, I think, for that to be worth it. I'm leaning towards unit test debuggability and readability, so I'll duplicate the unit test for iOS in a later PR.","created_at":"2018-11-09T02:45:00Z","updated_at":"2018-11-21T00:35:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0d77f2e4379e0fe487982589b33ad6cf71761293","assignee":{"login":"hiranya911","id":2375201,"node_id":"MDQ6VXNlcjIzNzUyMDE=","avatar_url":"https://avatars1.githubusercontent.com/u/2375201?v=4","gravatar_id":"","url":"https://api.github.com/users/hiranya911","html_url":"https://github.com/hiranya911","followers_url":"https://api.github.com/users/hiranya911/followers","following_url":"https://api.github.com/users/hiranya911/following{/other_user}","gists_url":"https://api.github.com/users/hiranya911/gists{/gist_id}","starred_url":"https://api.github.com/users/hiranya911/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hiranya911/subscriptions","organizations_url":"https://api.github.com/users/hiranya911/orgs","repos_url":"https://api.github.com/users/hiranya911/repos","events_url":"https://api.github.com/users/hiranya911/events{/privacy}","received_events_url":"https://api.github.com/users/hiranya911/received_events","type":"User","site_admin":false},"assignees":[{"login":"hiranya911","id":2375201,"node_id":"MDQ6VXNlcjIzNzUyMDE=","avatar_url":"https://avatars1.githubusercontent.com/u/2375201?v=4","gravatar_id":"","url":"https://api.github.com/users/hiranya911","html_url":"https://github.com/hiranya911","followers_url":"https://api.github.com/users/hiranya911/followers","following_url":"https://api.github.com/users/hiranya911/following{/other_user}","gists_url":"https://api.github.com/users/hiranya911/gists{/gist_id}","starred_url":"https://api.github.com/users/hiranya911/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hiranya911/subscriptions","organizations_url":"https://api.github.com/users/hiranya911/orgs","repos_url":"https://api.github.com/users/hiranya911/repos","events_url":"https://api.github.com/users/hiranya911/events{/privacy}","received_events_url":"https://api.github.com/users/hiranya911/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/firebase/firebase-admin-python/pulls/218/commits","review_comments_url":"https://api.github.com/repos/firebase/firebase-admin-python/pulls/218/comments","review_comment_url":"https://api.github.com/repos/firebase/firebase-admin-python/pulls/comments{/number}","comments_url":"https://api.github.com/repos/firebase/firebase-admin-python/issues/218/comments","statuses_url":"https://api.github.com/repos/firebase/firebase-admin-python/statuses/9ab187c74fb33a6ec29cb5e101034e4fa52a40af","head":{"label":"firebase:weixifan-project-management-6","ref":"weixifan-project-management-6","sha":"9ab187c74fb33a6ec29cb5e101034e4fa52a40af","user":{"login":"firebase","id":1335026,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzMzUwMjY=","avatar_url":"https://avatars2.githubusercontent.com/u/1335026?v=4","gravatar_id":"","url":"https://api.github.com/users/firebase","html_url":"https://github.com/firebase","followers_url":"https://api.github.com/users/firebase/followers","following_url":"https://api.github.com/users/firebase/following{/other_user}","gists_url":"https://api.github.com/users/firebase/gists{/gist_id}","starred_url":"https://api.github.com/users/firebase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/firebase/subscriptions","organizations_url":"https://api.github.com/users/firebase/orgs","repos_url":"https://api.github.com/users/firebase/repos","events_url":"https://api.github.com/users/firebase/events{/privacy}","received_events_url":"https://api.github.com/users/firebase/received_events","type":"Organization","site_admin":false},"repo":{"id":84979152,"node_id":"MDEwOlJlcG9zaXRvcnk4NDk3OTE1Mg==","name":"firebase-admin-python","full_name":"firebase/firebase-admin-python","private":false,"owner":{"login":"firebase","id":1335026,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzMzUwMjY=","avatar_url":"https://avatars2.githubusercontent.com/u/1335026?v=4","gravatar_id":"","url":"https://api.github.com/users/firebase","html_url":"https://github.com/firebase","followers_url":"https://api.github.com/users/firebase/followers","following_url":"https://api.github.com/users/firebase/following{/other_user}","gists_url":"https://api.github.com/users/firebase/gists{/gist_id}","starred_url":"https://api.github.com/users/firebase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/firebase/subscriptions","organizations_url":"https://api.github.com/users/firebase/orgs","repos_url":"https://api.github.com/users/firebase/repos","events_url":"https://api.github.com/users/firebase/events{/privacy}","received_events_url":"https://api.github.com/users/firebase/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/firebase/firebase-admin-python","description":"Firebase Admin Python SDK","fork":false,"url":"https://api.github.com/repos/firebase/firebase-admin-python","forks_url":"https://api.github.com/repos/firebase/firebase-admin-python/forks","keys_url":"https://api.github.com/repos/firebase/firebase-admin-python/keys{/key_id}","collaborators_url":"https://api.github.com/repos/firebase/firebase-admin-python/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/firebase/firebase-admin-python/teams","hooks_url":"https://api.github.com/repos/firebase/firebase-admin-python/hooks","issue_events_url":"https://api.github.com/repos/firebase/firebase-admin-python/issues/events{/number}","events_url":"https://api.github.com/repos/firebase/firebase-admin-python/events","assignees_url":"https://api.github.com/repos/firebase/firebase-admin-python/assignees{/user}","branches_url":"https://api.github.com/repos/firebase/firebase-admin-python/branches{/branch}","tags_url":"https://api.github.com/repos/firebase/firebase-admin-python/tags","blobs_url":"https://api.github.com/repos/firebase/firebase-admin-python/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/firebase/firebase-admin-python/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/firebase/firebase-admin-python/git/refs{/sha}","trees_url":"https://api.github.com/repos/firebase/firebase-admin-python/git/trees{/sha}","statuses_url":"https://api.github.com/repos/firebase/firebase-admin-python/statuses/{sha}","languages_url":"https://api.github.com/repos/firebase/firebase-admin-python/languages","stargazers_url":"https://api.github.com/repos/firebase/firebase-admin-python/stargazers","contributors_url":"https://api.github.com/repos/firebase/firebase-admin-python/contributors","subscribers_url":"https://api.github.com/repos/firebase/firebase-admin-python/subscribers","subscription_url":"https://api.github.com/repos/firebase/firebase-admin-python/subscription","commits_url":"https://api.github.com/repos/firebase/firebase-admin-python/commits{/sha}","git_commits_url":"https://api.github.com/repos/firebase/firebase-admin-python/git/commits{/sha}","comments_url":"https://api.github.com/repos/firebase/firebase-admin-python/comments{/number}","issue_comment_url":"https://api.github.com/repos/firebase/firebase-admin-python/issues/comments{/number}","contents_url":"https://api.github.com/repos/firebase/firebase-admin-python/contents/{+path}","compare_url":"https://api.github.com/repos/firebase/firebase-admin-python/compare/{base}...{head}","merges_url":"https://api.github.com/repos/firebase/firebase-admin-python/merges","archive_url":"https://api.github.com/repos/firebase/firebase-admin-python/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/firebase/firebase-admin-python/downloads","issues_url":"https://api.github.com/repos/firebase/firebase-admin-python/issues{/number}","pulls_url":"https://api.github.com/repos/firebase/firebase-admin-python/pulls{/number}","milestones_url":"https://api.github.com/repos/firebase/firebase-admin-python/milestones{/number}","notifications_url":"https://api.github.com/repos/firebase/firebase-admin-python/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/firebase/firebase-admin-python/labels{/name}","releases_url":"https://api.github.com/repos/firebase/firebase-admin-python/releases{/id}","deployments_url":"https://api.github.com/repos/firebase/firebase-admin-python/deployments","created_at":"2017-03-14T17:40:16Z","updated_at":"2018-11-20T18:30:34Z","pushed_at":"2018-11-20T22:03:28Z","git_url":"git://github.com/firebase/firebase-admin-python.git","ssh_url":"git@github.com:firebase/firebase-admin-python.git","clone_url":"https://github.com/firebase/firebase-admin-python.git","svn_url":"https://github.com/firebase/firebase-admin-python","homepage":"https://firebase.google.com/docs/admin/setup","size":579,"stargazers_count":227,"watchers_count":227,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":71,"mirror_url":null,"archived":false,"open_issues_count":21,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":71,"open_issues":21,"watchers":227,"default_branch":"master"}},"base":{"label":"firebase:project-mgt-service","ref":"project-mgt-service","sha":"2add92c6a722947a9807881ba18eaf58218bf6ff","user":{"login":"firebase","id":1335026,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzMzUwMjY=","avatar_url":"https://avatars2.githubusercontent.com/u/1335026?v=4","gravatar_id":"","url":"https://api.github.com/users/firebase","html_url":"https://github.com/firebase","followers_url":"https://api.github.com/users/firebase/followers","following_url":"https://api.github.com/users/firebase/following{/other_user}","gists_url":"https://api.github.com/users/firebase/gists{/gist_id}","starred_url":"https://api.github.com/users/firebase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/firebase/subscriptions","organizations_url":"https://api.github.com/users/firebase/orgs","repos_url":"https://api.github.com/users/firebase/repos","events_url":"https://api.github.com/users/firebase/events{/privacy}","received_events_url":"https://api.github.com/users/firebase/received_events","type":"Organization","site_admin":false},"repo":{"id":84979152,"node_id":"MDEwOlJlcG9zaXRvcnk4NDk3OTE1Mg==","name":"firebase-admin-python","full_name":"firebase/firebase-admin-python","private":false,"owner":{"login":"firebase","id":1335026,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzMzUwMjY=","avatar_url":"https://avatars2.githubusercontent.com/u/1335026?v=4","gravatar_id":"","url":"https://api.github.com/users/firebase","html_url":"https://github.com/firebase","followers_url":"https://api.github.com/users/firebase/followers","following_url":"https://api.github.com/users/firebase/following{/other_user}","gists_url":"https://api.github.com/users/firebase/gists{/gist_id}","starred_url":"https://api.github.com/users/firebase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/firebase/subscriptions","organizations_url":"https://api.github.com/users/firebase/orgs","repos_url":"https://api.github.com/users/firebase/repos","events_url":"https://api.github.com/users/firebase/events{/privacy}","received_events_url":"https://api.github.com/users/firebase/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/firebase/firebase-admin-python","description":"Firebase Admin Python SDK","fork":false,"url":"https://api.github.com/repos/firebase/firebase-admin-python","forks_url":"https://api.github.com/repos/firebase/firebase-admin-python/forks","keys_url":"https://api.github.com/repos/firebase/firebase-admin-python/keys{/key_id}","collaborators_url":"https://api.github.com/repos/firebase/firebase-admin-python/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/firebase/firebase-admin-python/teams","hooks_url":"https://api.github.com/repos/firebase/firebase-admin-python/hooks","issue_events_url":"https://api.github.com/repos/firebase/firebase-admin-python/issues/events{/number}","events_url":"https://api.github.com/repos/firebase/firebase-admin-python/events","assignees_url":"https://api.github.com/repos/firebase/firebase-admin-python/assignees{/user}","branches_url":"https://api.github.com/repos/firebase/firebase-admin-python/branches{/branch}","tags_url":"https://api.github.com/repos/firebase/firebase-admin-python/tags","blobs_url":"https://api.github.com/repos/firebase/firebase-admin-python/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/firebase/firebase-admin-python/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/firebase/firebase-admin-python/git/refs{/sha}","trees_url":"https://api.github.com/repos/firebase/firebase-admin-python/git/trees{/sha}","statuses_url":"https://api.github.com/repos/firebase/firebase-admin-python/statuses/{sha}","languages_url":"https://api.github.com/repos/firebase/firebase-admin-python/languages","stargazers_url":"https://api.github.com/repos/firebase/firebase-admin-python/stargazers","contributors_url":"https://api.github.com/repos/firebase/firebase-admin-python/contributors","subscribers_url":"https://api.github.com/repos/firebase/firebase-admin-python/subscribers","subscription_url":"https://api.github.com/repos/firebase/firebase-admin-python/subscription","commits_url":"https://api.github.com/repos/firebase/firebase-admin-python/commits{/sha}","git_commits_url":"https://api.github.com/repos/firebase/firebase-admin-python/git/commits{/sha}","comments_url":"https://api.github.com/repos/firebase/firebase-admin-python/comments{/number}","issue_comment_url":"https://api.github.com/repos/firebase/firebase-admin-python/issues/comments{/number}","contents_url":"https://api.github.com/repos/firebase/firebase-admin-python/contents/{+path}","compare_url":"https://api.github.com/repos/firebase/firebase-admin-python/compare/{base}...{head}","merges_url":"https://api.github.com/repos/firebase/firebase-admin-python/merges","archive_url":"https://api.github.com/repos/firebase/firebase-admin-python/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/firebase/firebase-admin-python/downloads","issues_url":"https://api.github.com/repos/firebase/firebase-admin-python/issues{/number}","pulls_url":"https://api.github.com/repos/firebase/firebase-admin-python/pulls{/number}","milestones_url":"https://api.github.com/repos/firebase/firebase-admin-python/milestones{/number}","notifications_url":"https://api.github.com/repos/firebase/firebase-admin-python/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/firebase/firebase-admin-python/labels{/name}","releases_url":"https://api.github.com/repos/firebase/firebase-admin-python/releases{/id}","deployments_url":"https://api.github.com/repos/firebase/firebase-admin-python/deployments","created_at":"2017-03-14T17:40:16Z","updated_at":"2018-11-20T18:30:34Z","pushed_at":"2018-11-20T22:03:28Z","git_url":"git://github.com/firebase/firebase-admin-python.git","ssh_url":"git@github.com:firebase/firebase-admin-python.git","clone_url":"https://github.com/firebase/firebase-admin-python.git","svn_url":"https://github.com/firebase/firebase-admin-python","homepage":"https://firebase.google.com/docs/admin/setup","size":579,"stargazers_count":227,"watchers_count":227,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":71,"mirror_url":null,"archived":false,"open_issues_count":21,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":71,"open_issues":21,"watchers":227,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/firebase/firebase-admin-python/pulls/218"},"html":{"href":"https://github.com/firebase/firebase-admin-python/pull/218"},"issue":{"href":"https://api.github.com/repos/firebase/firebase-admin-python/issues/218"},"comments":{"href":"https://api.github.com/repos/firebase/firebase-admin-python/issues/218/comments"},"review_comments":{"href":"https://api.github.com/repos/firebase/firebase-admin-python/pulls/218/comments"},"review_comment":{"href":"https://api.github.com/repos/firebase/firebase-admin-python/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/firebase/firebase-admin-python/pulls/218/commits"},"statuses":{"href":"https://api.github.com/repos/firebase/firebase-admin-python/statuses/9ab187c74fb33a6ec29cb5e101034e4fa52a40af"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"hiranya911"}}