{"action":"created","comment":{"url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/pulls/comments/87648941","pull_request_review_id":8256674,"id":87648941,"diff_hunk":"@@ -26,19 +26,25 @@ def _make_one(self, *args, **kw):\n         return self._get_target_class()(*args, **kw)\n \n     def test_ctor(self):\n+        import mock\n+        from oauth2client.client import GoogleCredentials\n         from google.cloud.language.connection import Connection\n \n-        creds = _Credentials()\n+        creds = mock.Mock(spec=GoogleCredentials)\n+        creds.create_scoped_required.return_value = False","path":"language/unit_tests/test_client.py","position":10,"original_position":10,"commit_id":"2077548703c28518f9c96f55aafea85fac2ac22a","original_commit_id":"2077548703c28518f9c96f55aafea85fac2ac22a","user":{"login":"dhermes","id":520669,"avatar_url":"https://avatars.githubusercontent.com/u/520669?v=3","gravatar_id":"","url":"https://api.github.com/users/dhermes","html_url":"https://github.com/dhermes","followers_url":"https://api.github.com/users/dhermes/followers","following_url":"https://api.github.com/users/dhermes/following{/other_user}","gists_url":"https://api.github.com/users/dhermes/gists{/gist_id}","starred_url":"https://api.github.com/users/dhermes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dhermes/subscriptions","organizations_url":"https://api.github.com/users/dhermes/orgs","repos_url":"https://api.github.com/users/dhermes/repos","events_url":"https://api.github.com/users/dhermes/events{/privacy}","received_events_url":"https://api.github.com/users/dhermes/received_events","type":"User","site_admin":false},"body":"@tseaver Before I write the helper I want to confirm how you mean with `kwargs`. ISTM it must be a layer of nesting:\r\n\r\n```python\r\ncreds = mock.Mock(\r\n    spec=GoogleCredentials,\r\n    create_scoped_required=mock.Mock(return_value=False))\r\n```\r\n\r\nunless there is some other syntax I'm unaware of?","created_at":"2016-11-11T19:55:27Z","updated_at":"2016-11-11T19:55:27Z","html_url":"https://github.com/GoogleCloudPlatform/google-cloud-python/pull/2681#discussion_r87648941","pull_request_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/pulls/2681","_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/pulls/comments/87648941"},"html":{"href":"https://github.com/GoogleCloudPlatform/google-cloud-python/pull/2681#discussion_r87648941"},"pull_request":{"href":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/pulls/2681"}}},"pull_request":{"url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/pulls/2681","id":92286774,"html_url":"https://github.com/GoogleCloudPlatform/google-cloud-python/pull/2681","diff_url":"https://github.com/GoogleCloudPlatform/google-cloud-python/pull/2681.diff","patch_url":"https://github.com/GoogleCloudPlatform/google-cloud-python/pull/2681.patch","issue_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/issues/2681","number":2681,"state":"open","locked":false,"title":"Use mock library in natural language tests.","user":{"login":"dhermes","id":520669,"avatar_url":"https://avatars.githubusercontent.com/u/520669?v=3","gravatar_id":"","url":"https://api.github.com/users/dhermes","html_url":"https://github.com/dhermes","followers_url":"https://api.github.com/users/dhermes/followers","following_url":"https://api.github.com/users/dhermes/following{/other_user}","gists_url":"https://api.github.com/users/dhermes/gists{/gist_id}","starred_url":"https://api.github.com/users/dhermes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dhermes/subscriptions","organizations_url":"https://api.github.com/users/dhermes/orgs","repos_url":"https://api.github.com/users/dhermes/repos","events_url":"https://api.github.com/users/dhermes/events{/privacy}","received_events_url":"https://api.github.com/users/dhermes/received_events","type":"User","site_admin":false},"body":"Also using PEP8 valid names in place of `_makeOne` and `_getTargetClass` and making all the `_get_target_class` methods a `@staticmethod` (since they don't use self).\r\n\r\n@tseaver LMKWYT, I know you are somewhat unsure of the `mock` library, so I wanted to give it a spin here to see what you think.","created_at":"2016-11-04T05:39:11Z","updated_at":"2016-11-11T19:55:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"86eca8b1642be2edbc000ece79dd0cdd7362109b","assignee":{"login":"daspecster","id":192456,"avatar_url":"https://avatars.githubusercontent.com/u/192456?v=3","gravatar_id":"","url":"https://api.github.com/users/daspecster","html_url":"https://github.com/daspecster","followers_url":"https://api.github.com/users/daspecster/followers","following_url":"https://api.github.com/users/daspecster/following{/other_user}","gists_url":"https://api.github.com/users/daspecster/gists{/gist_id}","starred_url":"https://api.github.com/users/daspecster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daspecster/subscriptions","organizations_url":"https://api.github.com/users/daspecster/orgs","repos_url":"https://api.github.com/users/daspecster/repos","events_url":"https://api.github.com/users/daspecster/events{/privacy}","received_events_url":"https://api.github.com/users/daspecster/received_events","type":"User","site_admin":false},"assignees":[{"login":"daspecster","id":192456,"avatar_url":"https://avatars.githubusercontent.com/u/192456?v=3","gravatar_id":"","url":"https://api.github.com/users/daspecster","html_url":"https://github.com/daspecster","followers_url":"https://api.github.com/users/daspecster/followers","following_url":"https://api.github.com/users/daspecster/following{/other_user}","gists_url":"https://api.github.com/users/daspecster/gists{/gist_id}","starred_url":"https://api.github.com/users/daspecster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daspecster/subscriptions","organizations_url":"https://api.github.com/users/daspecster/orgs","repos_url":"https://api.github.com/users/daspecster/repos","events_url":"https://api.github.com/users/daspecster/events{/privacy}","received_events_url":"https://api.github.com/users/daspecster/received_events","type":"User","site_admin":false},{"login":"tseaver","id":242750,"avatar_url":"https://avatars.githubusercontent.com/u/242750?v=3","gravatar_id":"","url":"https://api.github.com/users/tseaver","html_url":"https://github.com/tseaver","followers_url":"https://api.github.com/users/tseaver/followers","following_url":"https://api.github.com/users/tseaver/following{/other_user}","gists_url":"https://api.github.com/users/tseaver/gists{/gist_id}","starred_url":"https://api.github.com/users/tseaver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tseaver/subscriptions","organizations_url":"https://api.github.com/users/tseaver/orgs","repos_url":"https://api.github.com/users/tseaver/repos","events_url":"https://api.github.com/users/tseaver/events{/privacy}","received_events_url":"https://api.github.com/users/tseaver/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/pulls/2681/commits","review_comments_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/pulls/2681/comments","review_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/pulls/comments{/number}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/issues/2681/comments","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/statuses/2077548703c28518f9c96f55aafea85fac2ac22a","head":{"label":"dhermes:use-mock-in-language","ref":"use-mock-in-language","sha":"2077548703c28518f9c96f55aafea85fac2ac22a","user":{"login":"dhermes","id":520669,"avatar_url":"https://avatars.githubusercontent.com/u/520669?v=3","gravatar_id":"","url":"https://api.github.com/users/dhermes","html_url":"https://github.com/dhermes","followers_url":"https://api.github.com/users/dhermes/followers","following_url":"https://api.github.com/users/dhermes/following{/other_user}","gists_url":"https://api.github.com/users/dhermes/gists{/gist_id}","starred_url":"https://api.github.com/users/dhermes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dhermes/subscriptions","organizations_url":"https://api.github.com/users/dhermes/orgs","repos_url":"https://api.github.com/users/dhermes/repos","events_url":"https://api.github.com/users/dhermes/events{/privacy}","received_events_url":"https://api.github.com/users/dhermes/received_events","type":"User","site_admin":false},"repo":{"id":23001795,"name":"google-cloud-python","full_name":"dhermes/google-cloud-python","owner":{"login":"dhermes","id":520669,"avatar_url":"https://avatars.githubusercontent.com/u/520669?v=3","gravatar_id":"","url":"https://api.github.com/users/dhermes","html_url":"https://github.com/dhermes","followers_url":"https://api.github.com/users/dhermes/followers","following_url":"https://api.github.com/users/dhermes/following{/other_user}","gists_url":"https://api.github.com/users/dhermes/gists{/gist_id}","starred_url":"https://api.github.com/users/dhermes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dhermes/subscriptions","organizations_url":"https://api.github.com/users/dhermes/orgs","repos_url":"https://api.github.com/users/dhermes/repos","events_url":"https://api.github.com/users/dhermes/events{/privacy}","received_events_url":"https://api.github.com/users/dhermes/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dhermes/google-cloud-python","description":"Google Cloud Python Client Library","fork":true,"url":"https://api.github.com/repos/dhermes/google-cloud-python","forks_url":"https://api.github.com/repos/dhermes/google-cloud-python/forks","keys_url":"https://api.github.com/repos/dhermes/google-cloud-python/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dhermes/google-cloud-python/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dhermes/google-cloud-python/teams","hooks_url":"https://api.github.com/repos/dhermes/google-cloud-python/hooks","issue_events_url":"https://api.github.com/repos/dhermes/google-cloud-python/issues/events{/number}","events_url":"https://api.github.com/repos/dhermes/google-cloud-python/events","assignees_url":"https://api.github.com/repos/dhermes/google-cloud-python/assignees{/user}","branches_url":"https://api.github.com/repos/dhermes/google-cloud-python/branches{/branch}","tags_url":"https://api.github.com/repos/dhermes/google-cloud-python/tags","blobs_url":"https://api.github.com/repos/dhermes/google-cloud-python/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dhermes/google-cloud-python/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dhermes/google-cloud-python/git/refs{/sha}","trees_url":"https://api.github.com/repos/dhermes/google-cloud-python/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dhermes/google-cloud-python/statuses/{sha}","languages_url":"https://api.github.com/repos/dhermes/google-cloud-python/languages","stargazers_url":"https://api.github.com/repos/dhermes/google-cloud-python/stargazers","contributors_url":"https://api.github.com/repos/dhermes/google-cloud-python/contributors","subscribers_url":"https://api.github.com/repos/dhermes/google-cloud-python/subscribers","subscription_url":"https://api.github.com/repos/dhermes/google-cloud-python/subscription","commits_url":"https://api.github.com/repos/dhermes/google-cloud-python/commits{/sha}","git_commits_url":"https://api.github.com/repos/dhermes/google-cloud-python/git/commits{/sha}","comments_url":"https://api.github.com/repos/dhermes/google-cloud-python/comments{/number}","issue_comment_url":"https://api.github.com/repos/dhermes/google-cloud-python/issues/comments{/number}","contents_url":"https://api.github.com/repos/dhermes/google-cloud-python/contents/{+path}","compare_url":"https://api.github.com/repos/dhermes/google-cloud-python/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dhermes/google-cloud-python/merges","archive_url":"https://api.github.com/repos/dhermes/google-cloud-python/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dhermes/google-cloud-python/downloads","issues_url":"https://api.github.com/repos/dhermes/google-cloud-python/issues{/number}","pulls_url":"https://api.github.com/repos/dhermes/google-cloud-python/pulls{/number}","milestones_url":"https://api.github.com/repos/dhermes/google-cloud-python/milestones{/number}","notifications_url":"https://api.github.com/repos/dhermes/google-cloud-python/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dhermes/google-cloud-python/labels{/name}","releases_url":"https://api.github.com/repos/dhermes/google-cloud-python/releases{/id}","deployments_url":"https://api.github.com/repos/dhermes/google-cloud-python/deployments","created_at":"2014-08-15T20:18:30Z","updated_at":"2016-10-24T16:27:52Z","pushed_at":"2016-11-11T19:40:49Z","git_url":"git://github.com/dhermes/google-cloud-python.git","ssh_url":"git@github.com:dhermes/google-cloud-python.git","clone_url":"https://github.com/dhermes/google-cloud-python.git","svn_url":"https://github.com/dhermes/google-cloud-python","homepage":"http://googlecloudplatform.github.io/gcloud-python/","size":14656,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":2,"default_branch":"master"}},"base":{"label":"GoogleCloudPlatform:master","ref":"master","sha":"039f1cc9a09c274e16a062046515210a5202efc1","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":16316451,"name":"google-cloud-python","full_name":"GoogleCloudPlatform/google-cloud-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/google-cloud-python","description":"Google Cloud Client Library for Python","fork":false,"url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python","forks_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/forks","keys_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/teams","hooks_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/hooks","issue_events_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/issues/events{/number}","events_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/events","assignees_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/assignees{/user}","branches_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/branches{/branch}","tags_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/tags","blobs_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/git/refs{/sha}","trees_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/statuses/{sha}","languages_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/languages","stargazers_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/stargazers","contributors_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/contributors","subscribers_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/subscribers","subscription_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/subscription","commits_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/commits{/sha}","git_commits_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/git/commits{/sha}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/comments{/number}","issue_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/issues/comments{/number}","contents_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/contents/{+path}","compare_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/merges","archive_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/downloads","issues_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/issues{/number}","pulls_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/pulls{/number}","milestones_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/milestones{/number}","notifications_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/labels{/name}","releases_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/releases{/id}","deployments_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/deployments","created_at":"2014-01-28T15:51:47Z","updated_at":"2016-11-11T06:00:44Z","pushed_at":"2016-11-11T19:49:57Z","git_url":"git://github.com/GoogleCloudPlatform/google-cloud-python.git","ssh_url":"git@github.com:GoogleCloudPlatform/google-cloud-python.git","clone_url":"https://github.com/GoogleCloudPlatform/google-cloud-python.git","svn_url":"https://github.com/GoogleCloudPlatform/google-cloud-python","homepage":"https://googlecloudplatform.github.io/google-cloud-python/","size":102130,"stargazers_count":447,"watchers_count":447,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":225,"mirror_url":null,"open_issues_count":255,"forks":225,"open_issues":255,"watchers":447,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/pulls/2681"},"html":{"href":"https://github.com/GoogleCloudPlatform/google-cloud-python/pull/2681"},"issue":{"href":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/issues/2681"},"comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/issues/2681/comments"},"review_comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/pulls/2681/comments"},"review_comment":{"href":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/pulls/2681/commits"},"statuses":{"href":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/statuses/2077548703c28518f9c96f55aafea85fac2ac22a"}}}}
{"actor":{"display_login":"dhermes"}}