{"action":"created","comment":{"url":"https://api.github.com/repos/jupyter-incubator/enterprise_gateway/pulls/comments/191051889","pull_request_review_id":123559672,"id":191051889,"diff_hunk":"@@ -20,23 +20,64 @@ def setUp(self):\n     def tearDown(self):\n         pass\n \n-    def test_authorized_users(self):\n+    def test_authorized_users_when_all_values_are_passed(self):\n         kernel = None\n         try:\n-            kernel = self.gateway_client.start_kernel(TestAuthorization.KERNELSPEC, username='bob')\n+            kernel = self.gateway_client.start_kernel('authorization_complete', username='authorized_user_1')\n             result = kernel.execute(\"print('The cow jumped over the moon.')\")\n             self.assertEquals(result, \"The cow jumped over the moon.\\n\")\n         finally:\n             if kernel:\n                 kernel.shutdown()\n \n-    def test_unauthorized_users(self):\n+    def test_authorized_users_when_only_authorized_values_are_passed(self):\n         kernel = None\n         try:\n-            kernel = self.gateway_client.start_kernel(TestAuthorization.KERNELSPEC, username='bad_guy')\n+            kernel = self.gateway_client.start_kernel('authorization_authorized', username='authorized_user_1')\n+            result = kernel.execute(\"print('The cow jumped over the moon.')\")\n+            self.assertEquals(result, \"The cow jumped over the moon.\\n\")\n+        finally:\n+            if kernel:\n+                kernel.shutdown()\n+\n+    def test_authorized_users_when_no_values_are_passed(self):\n+        kernel = None\n+        try:\n+            kernel = self.gateway_client.start_kernel('authorization_empty', username='authorized_user_1')\n+            result = kernel.execute(\"print('The cow jumped over the moon.')\")\n+            self.assertEquals(result, \"The cow jumped over the moon.\\n\")\n+        finally:\n+            if kernel:\n+                kernel.shutdown()\n+\n+    def test_unauthorized_users_when_all_values_are_passed(self):\n+        kernel = None\n+        try:\n+            kernel = self.gateway_client.start_kernel('authorization_complete', username='unauthorized_user_1')\n             self.assertTrue(False, msg=\"Unauthorization exception expected!\")\n         except Exception as be:\n-            self.assertRegexpMatches(be.args[0], \"403\")\n+            self.assertRegex(be.args[0], \"403\")\n+        finally:\n+            if kernel:\n+                kernel.shutdown()\n+\n+    def test_unauthorized_users_when_only_unauthorized_values_are_passed(self):","path":"enterprise_gateway/itests/test_authorization.py","position":50,"original_position":50,"commit_id":"d99bc9977ff5ea39296c02ed0d0f7ee96a9c2737","original_commit_id":"d99bc9977ff5ea39296c02ed0d0f7ee96a9c2737","user":{"login":"kevin-bates","id":22599560,"avatar_url":"https://avatars0.githubusercontent.com/u/22599560?v=4","gravatar_id":"","url":"https://api.github.com/users/kevin-bates","html_url":"https://github.com/kevin-bates","followers_url":"https://api.github.com/users/kevin-bates/followers","following_url":"https://api.github.com/users/kevin-bates/following{/other_user}","gists_url":"https://api.github.com/users/kevin-bates/gists{/gist_id}","starred_url":"https://api.github.com/users/kevin-bates/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevin-bates/subscriptions","organizations_url":"https://api.github.com/users/kevin-bates/orgs","repos_url":"https://api.github.com/users/kevin-bates/repos","events_url":"https://api.github.com/users/kevin-bates/events{/privacy}","received_events_url":"https://api.github.com/users/kevin-bates/received_events","type":"User","site_admin":false},"body":"How about `test_only_unauthorized_users`?","created_at":"2018-05-26T15:31:33Z","updated_at":"2018-05-26T15:34:50Z","html_url":"https://github.com/jupyter-incubator/enterprise_gateway/pull/360#discussion_r191051889","pull_request_url":"https://api.github.com/repos/jupyter-incubator/enterprise_gateway/pulls/360","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/jupyter-incubator/enterprise_gateway/pulls/comments/191051889"},"html":{"href":"https://github.com/jupyter-incubator/enterprise_gateway/pull/360#discussion_r191051889"},"pull_request":{"href":"https://api.github.com/repos/jupyter-incubator/enterprise_gateway/pulls/360"}}},"pull_request":{"url":"https://api.github.com/repos/jupyter-incubator/enterprise_gateway/pulls/360","id":190728956,"html_url":"https://github.com/jupyter-incubator/enterprise_gateway/pull/360","diff_url":"https://github.com/jupyter-incubator/enterprise_gateway/pull/360.diff","patch_url":"https://github.com/jupyter-incubator/enterprise_gateway/pull/360.patch","issue_url":"https://api.github.com/repos/jupyter-incubator/enterprise_gateway/issues/360","number":360,"state":"open","locked":false,"title":"Fix kernel initialization when no authorization info available","user":{"login":"lresende","id":382917,"avatar_url":"https://avatars3.githubusercontent.com/u/382917?v=4","gravatar_id":"","url":"https://api.github.com/users/lresende","html_url":"https://github.com/lresende","followers_url":"https://api.github.com/users/lresende/followers","following_url":"https://api.github.com/users/lresende/following{/other_user}","gists_url":"https://api.github.com/users/lresende/gists{/gist_id}","starred_url":"https://api.github.com/users/lresende/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lresende/subscriptions","organizations_url":"https://api.github.com/users/lresende/orgs","repos_url":"https://api.github.com/users/lresende/repos","events_url":"https://api.github.com/users/lresende/events{/privacy}","received_events_url":"https://api.github.com/users/lresende/received_events","type":"User","site_admin":false},"body":"Extend the authorized/unauthorized tests and fix issue when\r\nno authorization values were provided.","created_at":"2018-05-26T06:48:08Z","updated_at":"2018-05-26T15:34:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6ee45401284b007f0de0b9d71dfa43230e2efbb9","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/jupyter-incubator/enterprise_gateway/pulls/360/commits","review_comments_url":"https://api.github.com/repos/jupyter-incubator/enterprise_gateway/pulls/360/comments","review_comment_url":"https://api.github.com/repos/jupyter-incubator/enterprise_gateway/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jupyter-incubator/enterprise_gateway/issues/360/comments","statuses_url":"https://api.github.com/repos/jupyter-incubator/enterprise_gateway/statuses/d99bc9977ff5ea39296c02ed0d0f7ee96a9c2737","head":{"label":"lresende:authorization-test","ref":"authorization-test","sha":"d99bc9977ff5ea39296c02ed0d0f7ee96a9c2737","user":{"login":"lresende","id":382917,"avatar_url":"https://avatars3.githubusercontent.com/u/382917?v=4","gravatar_id":"","url":"https://api.github.com/users/lresende","html_url":"https://github.com/lresende","followers_url":"https://api.github.com/users/lresende/followers","following_url":"https://api.github.com/users/lresende/following{/other_user}","gists_url":"https://api.github.com/users/lresende/gists{/gist_id}","starred_url":"https://api.github.com/users/lresende/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lresende/subscriptions","organizations_url":"https://api.github.com/users/lresende/orgs","repos_url":"https://api.github.com/users/lresende/repos","events_url":"https://api.github.com/users/lresende/events{/privacy}","received_events_url":"https://api.github.com/users/lresende/received_events","type":"User","site_admin":false},"repo":{"id":106029122,"name":"enterprise_gateway","full_name":"lresende/enterprise_gateway","owner":{"login":"lresende","id":382917,"avatar_url":"https://avatars3.githubusercontent.com/u/382917?v=4","gravatar_id":"","url":"https://api.github.com/users/lresende","html_url":"https://github.com/lresende","followers_url":"https://api.github.com/users/lresende/followers","following_url":"https://api.github.com/users/lresende/following{/other_user}","gists_url":"https://api.github.com/users/lresende/gists{/gist_id}","starred_url":"https://api.github.com/users/lresende/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lresende/subscriptions","organizations_url":"https://api.github.com/users/lresende/orgs","repos_url":"https://api.github.com/users/lresende/repos","events_url":"https://api.github.com/users/lresende/events{/privacy}","received_events_url":"https://api.github.com/users/lresende/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lresende/enterprise_gateway","description":"A lightweight, multi tenant, scalable and secure gateway that enables Jupyter Notebooks to share resources across an Apache Spark cluster.","fork":true,"url":"https://api.github.com/repos/lresende/enterprise_gateway","forks_url":"https://api.github.com/repos/lresende/enterprise_gateway/forks","keys_url":"https://api.github.com/repos/lresende/enterprise_gateway/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lresende/enterprise_gateway/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lresende/enterprise_gateway/teams","hooks_url":"https://api.github.com/repos/lresende/enterprise_gateway/hooks","issue_events_url":"https://api.github.com/repos/lresende/enterprise_gateway/issues/events{/number}","events_url":"https://api.github.com/repos/lresende/enterprise_gateway/events","assignees_url":"https://api.github.com/repos/lresende/enterprise_gateway/assignees{/user}","branches_url":"https://api.github.com/repos/lresende/enterprise_gateway/branches{/branch}","tags_url":"https://api.github.com/repos/lresende/enterprise_gateway/tags","blobs_url":"https://api.github.com/repos/lresende/enterprise_gateway/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lresende/enterprise_gateway/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lresende/enterprise_gateway/git/refs{/sha}","trees_url":"https://api.github.com/repos/lresende/enterprise_gateway/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lresende/enterprise_gateway/statuses/{sha}","languages_url":"https://api.github.com/repos/lresende/enterprise_gateway/languages","stargazers_url":"https://api.github.com/repos/lresende/enterprise_gateway/stargazers","contributors_url":"https://api.github.com/repos/lresende/enterprise_gateway/contributors","subscribers_url":"https://api.github.com/repos/lresende/enterprise_gateway/subscribers","subscription_url":"https://api.github.com/repos/lresende/enterprise_gateway/subscription","commits_url":"https://api.github.com/repos/lresende/enterprise_gateway/commits{/sha}","git_commits_url":"https://api.github.com/repos/lresende/enterprise_gateway/git/commits{/sha}","comments_url":"https://api.github.com/repos/lresende/enterprise_gateway/comments{/number}","issue_comment_url":"https://api.github.com/repos/lresende/enterprise_gateway/issues/comments{/number}","contents_url":"https://api.github.com/repos/lresende/enterprise_gateway/contents/{+path}","compare_url":"https://api.github.com/repos/lresende/enterprise_gateway/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lresende/enterprise_gateway/merges","archive_url":"https://api.github.com/repos/lresende/enterprise_gateway/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lresende/enterprise_gateway/downloads","issues_url":"https://api.github.com/repos/lresende/enterprise_gateway/issues{/number}","pulls_url":"https://api.github.com/repos/lresende/enterprise_gateway/pulls{/number}","milestones_url":"https://api.github.com/repos/lresende/enterprise_gateway/milestones{/number}","notifications_url":"https://api.github.com/repos/lresende/enterprise_gateway/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lresende/enterprise_gateway/labels{/name}","releases_url":"https://api.github.com/repos/lresende/enterprise_gateway/releases{/id}","deployments_url":"https://api.github.com/repos/lresende/enterprise_gateway/deployments","created_at":"2017-10-06T16:57:28Z","updated_at":"2018-04-27T17:27:08Z","pushed_at":"2018-05-26T06:47:28Z","git_url":"git://github.com/lresende/enterprise_gateway.git","ssh_url":"git@github.com:lresende/enterprise_gateway.git","clone_url":"https://github.com/lresende/enterprise_gateway.git","svn_url":"https://github.com/lresende/enterprise_gateway","homepage":"","size":1707,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"jupyter-incubator:master","ref":"master","sha":"d0546a9e5e7acfa55fee43aa262a96c7b098a011","user":{"login":"jupyter-incubator","id":14002361,"avatar_url":"https://avatars0.githubusercontent.com/u/14002361?v=4","gravatar_id":"","url":"https://api.github.com/users/jupyter-incubator","html_url":"https://github.com/jupyter-incubator","followers_url":"https://api.github.com/users/jupyter-incubator/followers","following_url":"https://api.github.com/users/jupyter-incubator/following{/other_user}","gists_url":"https://api.github.com/users/jupyter-incubator/gists{/gist_id}","starred_url":"https://api.github.com/users/jupyter-incubator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jupyter-incubator/subscriptions","organizations_url":"https://api.github.com/users/jupyter-incubator/orgs","repos_url":"https://api.github.com/users/jupyter-incubator/repos","events_url":"https://api.github.com/users/jupyter-incubator/events{/privacy}","received_events_url":"https://api.github.com/users/jupyter-incubator/received_events","type":"Organization","site_admin":false},"repo":{"id":89001469,"name":"enterprise_gateway","full_name":"jupyter-incubator/enterprise_gateway","owner":{"login":"jupyter-incubator","id":14002361,"avatar_url":"https://avatars0.githubusercontent.com/u/14002361?v=4","gravatar_id":"","url":"https://api.github.com/users/jupyter-incubator","html_url":"https://github.com/jupyter-incubator","followers_url":"https://api.github.com/users/jupyter-incubator/followers","following_url":"https://api.github.com/users/jupyter-incubator/following{/other_user}","gists_url":"https://api.github.com/users/jupyter-incubator/gists{/gist_id}","starred_url":"https://api.github.com/users/jupyter-incubator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jupyter-incubator/subscriptions","organizations_url":"https://api.github.com/users/jupyter-incubator/orgs","repos_url":"https://api.github.com/users/jupyter-incubator/repos","events_url":"https://api.github.com/users/jupyter-incubator/events{/privacy}","received_events_url":"https://api.github.com/users/jupyter-incubator/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/jupyter-incubator/enterprise_gateway","description":"A lightweight, multi-tenant, scalable and secure gateway that enables Jupyter Notebooks to share resources across an Apache Spark cluster.","fork":false,"url":"https://api.github.com/repos/jupyter-incubator/enterprise_gateway","forks_url":"https://api.github.com/repos/jupyter-incubator/enterprise_gateway/forks","keys_url":"https://api.github.com/repos/jupyter-incubator/enterprise_gateway/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jupyter-incubator/enterprise_gateway/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jupyter-incubator/enterprise_gateway/teams","hooks_url":"https://api.github.com/repos/jupyter-incubator/enterprise_gateway/hooks","issue_events_url":"https://api.github.com/repos/jupyter-incubator/enterprise_gateway/issues/events{/number}","events_url":"https://api.github.com/repos/jupyter-incubator/enterprise_gateway/events","assignees_url":"https://api.github.com/repos/jupyter-incubator/enterprise_gateway/assignees{/user}","branches_url":"https://api.github.com/repos/jupyter-incubator/enterprise_gateway/branches{/branch}","tags_url":"https://api.github.com/repos/jupyter-incubator/enterprise_gateway/tags","blobs_url":"https://api.github.com/repos/jupyter-incubator/enterprise_gateway/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jupyter-incubator/enterprise_gateway/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jupyter-incubator/enterprise_gateway/git/refs{/sha}","trees_url":"https://api.github.com/repos/jupyter-incubator/enterprise_gateway/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jupyter-incubator/enterprise_gateway/statuses/{sha}","languages_url":"https://api.github.com/repos/jupyter-incubator/enterprise_gateway/languages","stargazers_url":"https://api.github.com/repos/jupyter-incubator/enterprise_gateway/stargazers","contributors_url":"https://api.github.com/repos/jupyter-incubator/enterprise_gateway/contributors","subscribers_url":"https://api.github.com/repos/jupyter-incubator/enterprise_gateway/subscribers","subscription_url":"https://api.github.com/repos/jupyter-incubator/enterprise_gateway/subscription","commits_url":"https://api.github.com/repos/jupyter-incubator/enterprise_gateway/commits{/sha}","git_commits_url":"https://api.github.com/repos/jupyter-incubator/enterprise_gateway/git/commits{/sha}","comments_url":"https://api.github.com/repos/jupyter-incubator/enterprise_gateway/comments{/number}","issue_comment_url":"https://api.github.com/repos/jupyter-incubator/enterprise_gateway/issues/comments{/number}","contents_url":"https://api.github.com/repos/jupyter-incubator/enterprise_gateway/contents/{+path}","compare_url":"https://api.github.com/repos/jupyter-incubator/enterprise_gateway/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jupyter-incubator/enterprise_gateway/merges","archive_url":"https://api.github.com/repos/jupyter-incubator/enterprise_gateway/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jupyter-incubator/enterprise_gateway/downloads","issues_url":"https://api.github.com/repos/jupyter-incubator/enterprise_gateway/issues{/number}","pulls_url":"https://api.github.com/repos/jupyter-incubator/enterprise_gateway/pulls{/number}","milestones_url":"https://api.github.com/repos/jupyter-incubator/enterprise_gateway/milestones{/number}","notifications_url":"https://api.github.com/repos/jupyter-incubator/enterprise_gateway/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jupyter-incubator/enterprise_gateway/labels{/name}","releases_url":"https://api.github.com/repos/jupyter-incubator/enterprise_gateway/releases{/id}","deployments_url":"https://api.github.com/repos/jupyter-incubator/enterprise_gateway/deployments","created_at":"2017-04-21T16:05:14Z","updated_at":"2018-05-25T21:20:41Z","pushed_at":"2018-05-26T06:48:09Z","git_url":"git://github.com/jupyter-incubator/enterprise_gateway.git","ssh_url":"git@github.com:jupyter-incubator/enterprise_gateway.git","clone_url":"https://github.com/jupyter-incubator/enterprise_gateway.git","svn_url":"https://github.com/jupyter-incubator/enterprise_gateway","homepage":"http://jupyter-enterprise-gateway.readthedocs.io/en/latest/","size":1701,"stargazers_count":50,"watchers_count":50,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":22,"mirror_url":null,"archived":false,"open_issues_count":10,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":22,"open_issues":10,"watchers":50,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jupyter-incubator/enterprise_gateway/pulls/360"},"html":{"href":"https://github.com/jupyter-incubator/enterprise_gateway/pull/360"},"issue":{"href":"https://api.github.com/repos/jupyter-incubator/enterprise_gateway/issues/360"},"comments":{"href":"https://api.github.com/repos/jupyter-incubator/enterprise_gateway/issues/360/comments"},"review_comments":{"href":"https://api.github.com/repos/jupyter-incubator/enterprise_gateway/pulls/360/comments"},"review_comment":{"href":"https://api.github.com/repos/jupyter-incubator/enterprise_gateway/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jupyter-incubator/enterprise_gateway/pulls/360/commits"},"statuses":{"href":"https://api.github.com/repos/jupyter-incubator/enterprise_gateway/statuses/d99bc9977ff5ea39296c02ed0d0f7ee96a9c2737"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"kevin-bates"}}