{"action":"created","comment":{"url":"https://api.github.com/repos/plotly/python-api/pulls/comments/36834438","id":36834438,"diff_hunk":"@@ -66,3 +70,187 @@ def test_plot_empty_data(self):\n         py.sign_in('PlotlyImageTest', '786r5mecv0')\n         self.assertRaises(PlotlyEmptyDataError, py.plot, [],\n                           filename='plot_invalid')\n+\n+    def test_plot_sharing_argument(self):\n+\n+        # Raise an error if sharing argument is incorrect\n+        # correct arguments {'public, 'private', 'secret'}\n+\n+        fig = {\n+            'data': [\n+                {\n+                    'x': [1, 2, 3],\n+                    'y': [2, 1, 2]\n+                }\n+            ]\n+        }\n+\n+        kwargs = {'filename': 'invalid-sharing-argument',\n+                  'sharing': 'privste'}\n+\n+        with self.assertRaisesRegexp(PlotlyError, 'sharing'):\n+            py.plot(fig, **kwargs)\n+\n+    def test_plot_world_readable_sharing_conflict_1(self):\n+\n+        # Raise an error if world_readable=False but sharing='public'\n+\n+        fig = {\n+            'data': [\n+                {\n+                    'x': [1, 2, 3],\n+                    'y': [2, 1, 2]\n+                }\n+            ]\n+        }\n+\n+        kwargs = {'filename': 'invalid-privacy-setting',\n+                  'world_readable': False,\n+                  'sharing': 'public'}\n+\n+        with self.assertRaisesRegexp(PlotlyError, 'sharing'):\n+            py.plot(fig, **kwargs)\n+\n+    def test_plot_world_readable_sharing_conflict_2(self):\n+\n+        # Raise an error if world_readable=True but sharing='secret'\n+\n+        fig = {\n+            'data': [\n+                {\n+                    'x': [1, 2, 3],\n+                    'y': [2, 1, 2]\n+                }\n+            ]\n+        }\n+\n+        kwargs = {'filename': 'invalid-privacy-setting',\n+                  'world_readable': True,\n+                  'sharing': 'secret'}\n+\n+        with self.assertRaisesRegexp(PlotlyError, 'sharing'):","path":"plotly/tests/test_core/test_plotly/test_plot.py","position":81,"original_position":81,"commit_id":"85610b48b0e1dc14a6d157d5bf1d26c79b25b230","original_commit_id":"85610b48b0e1dc14a6d157d5bf1d26c79b25b230","user":{"login":"theengineear","id":6611546,"avatar_url":"https://avatars.githubusercontent.com/u/6611546?v=3","gravatar_id":"","url":"https://api.github.com/users/theengineear","html_url":"https://github.com/theengineear","followers_url":"https://api.github.com/users/theengineear/followers","following_url":"https://api.github.com/users/theengineear/following{/other_user}","gists_url":"https://api.github.com/users/theengineear/gists{/gist_id}","starred_url":"https://api.github.com/users/theengineear/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theengineear/subscriptions","organizations_url":"https://api.github.com/users/theengineear/orgs","repos_url":"https://api.github.com/users/theengineear/repos","events_url":"https://api.github.com/users/theengineear/events{/privacy}","received_events_url":"https://api.github.com/users/theengineear/received_events","type":"User","site_admin":false},"body":":smile_cat: ","created_at":"2015-08-12T07:54:34Z","updated_at":"2015-08-12T07:54:34Z","html_url":"https://github.com/plotly/python-api/pull/264#discussion_r36834438","pull_request_url":"https://api.github.com/repos/plotly/python-api/pulls/264","_links":{"self":{"href":"https://api.github.com/repos/plotly/python-api/pulls/comments/36834438"},"html":{"href":"https://github.com/plotly/python-api/pull/264#discussion_r36834438"},"pull_request":{"href":"https://api.github.com/repos/plotly/python-api/pulls/264"}}},"pull_request":{"url":"https://api.github.com/repos/plotly/python-api/pulls/264","id":40504250,"html_url":"https://github.com/plotly/python-api/pull/264","diff_url":"https://github.com/plotly/python-api/pull/264.diff","patch_url":"https://github.com/plotly/python-api/pull/264.patch","issue_url":"https://api.github.com/repos/plotly/python-api/issues/264","number":264,"state":"open","locked":false,"title":"Secret key","user":{"login":"aneda","id":5222384,"avatar_url":"https://avatars.githubusercontent.com/u/5222384?v=3","gravatar_id":"","url":"https://api.github.com/users/aneda","html_url":"https://github.com/aneda","followers_url":"https://api.github.com/users/aneda/followers","following_url":"https://api.github.com/users/aneda/following{/other_user}","gists_url":"https://api.github.com/users/aneda/gists{/gist_id}","starred_url":"https://api.github.com/users/aneda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aneda/subscriptions","organizations_url":"https://api.github.com/users/aneda/orgs","repos_url":"https://api.github.com/users/aneda/repos","events_url":"https://api.github.com/users/aneda/events{/privacy}","received_events_url":"https://api.github.com/users/aneda/received_events","type":"User","site_admin":false},"body":"@theengineear @chriddyp @cldougl \r\nHey, this is a rough draft for secret_key.  This only works for plot (py.plot(...)).  I haven't done any tests and I am working on iplot (being stuck there).  So I wanted to check if I am on the right track and this is what you had in mind.  Thnaks!","created_at":"2015-07-21T21:02:12Z","updated_at":"2015-08-12T07:54:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2651f8732e916f5489e9ce03cdccaee7bcef8c71","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/plotly/python-api/pulls/264/commits","review_comments_url":"https://api.github.com/repos/plotly/python-api/pulls/264/comments","review_comment_url":"https://api.github.com/repos/plotly/python-api/pulls/comments{/number}","comments_url":"https://api.github.com/repos/plotly/python-api/issues/264/comments","statuses_url":"https://api.github.com/repos/plotly/python-api/statuses/85610b48b0e1dc14a6d157d5bf1d26c79b25b230","head":{"label":"plotly:secret_key","ref":"secret_key","sha":"85610b48b0e1dc14a6d157d5bf1d26c79b25b230","user":{"login":"plotly","id":5997976,"avatar_url":"https://avatars.githubusercontent.com/u/5997976?v=3","gravatar_id":"","url":"https://api.github.com/users/plotly","html_url":"https://github.com/plotly","followers_url":"https://api.github.com/users/plotly/followers","following_url":"https://api.github.com/users/plotly/following{/other_user}","gists_url":"https://api.github.com/users/plotly/gists{/gist_id}","starred_url":"https://api.github.com/users/plotly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/plotly/subscriptions","organizations_url":"https://api.github.com/users/plotly/orgs","repos_url":"https://api.github.com/users/plotly/repos","events_url":"https://api.github.com/users/plotly/events{/privacy}","received_events_url":"https://api.github.com/users/plotly/received_events","type":"Organization","site_admin":false},"repo":{"id":14579099,"name":"python-api","full_name":"plotly/python-api","owner":{"login":"plotly","id":5997976,"avatar_url":"https://avatars.githubusercontent.com/u/5997976?v=3","gravatar_id":"","url":"https://api.github.com/users/plotly","html_url":"https://github.com/plotly","followers_url":"https://api.github.com/users/plotly/followers","following_url":"https://api.github.com/users/plotly/following{/other_user}","gists_url":"https://api.github.com/users/plotly/gists{/gist_id}","starred_url":"https://api.github.com/users/plotly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/plotly/subscriptions","organizations_url":"https://api.github.com/users/plotly/orgs","repos_url":"https://api.github.com/users/plotly/repos","events_url":"https://api.github.com/users/plotly/events{/privacy}","received_events_url":"https://api.github.com/users/plotly/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/plotly/python-api","description":"Python-API for beautiful, interactive, & shareable graphs ","fork":false,"url":"https://api.github.com/repos/plotly/python-api","forks_url":"https://api.github.com/repos/plotly/python-api/forks","keys_url":"https://api.github.com/repos/plotly/python-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/plotly/python-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/plotly/python-api/teams","hooks_url":"https://api.github.com/repos/plotly/python-api/hooks","issue_events_url":"https://api.github.com/repos/plotly/python-api/issues/events{/number}","events_url":"https://api.github.com/repos/plotly/python-api/events","assignees_url":"https://api.github.com/repos/plotly/python-api/assignees{/user}","branches_url":"https://api.github.com/repos/plotly/python-api/branches{/branch}","tags_url":"https://api.github.com/repos/plotly/python-api/tags","blobs_url":"https://api.github.com/repos/plotly/python-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/plotly/python-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/plotly/python-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/plotly/python-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/plotly/python-api/statuses/{sha}","languages_url":"https://api.github.com/repos/plotly/python-api/languages","stargazers_url":"https://api.github.com/repos/plotly/python-api/stargazers","contributors_url":"https://api.github.com/repos/plotly/python-api/contributors","subscribers_url":"https://api.github.com/repos/plotly/python-api/subscribers","subscription_url":"https://api.github.com/repos/plotly/python-api/subscription","commits_url":"https://api.github.com/repos/plotly/python-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/plotly/python-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/plotly/python-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/plotly/python-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/plotly/python-api/contents/{+path}","compare_url":"https://api.github.com/repos/plotly/python-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/plotly/python-api/merges","archive_url":"https://api.github.com/repos/plotly/python-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/plotly/python-api/downloads","issues_url":"https://api.github.com/repos/plotly/python-api/issues{/number}","pulls_url":"https://api.github.com/repos/plotly/python-api/pulls{/number}","milestones_url":"https://api.github.com/repos/plotly/python-api/milestones{/number}","notifications_url":"https://api.github.com/repos/plotly/python-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/plotly/python-api/labels{/name}","releases_url":"https://api.github.com/repos/plotly/python-api/releases{/id}","created_at":"2013-11-21T05:53:08Z","updated_at":"2015-08-09T07:13:33Z","pushed_at":"2015-08-11T22:39:50Z","git_url":"git://github.com/plotly/python-api.git","ssh_url":"git@github.com:plotly/python-api.git","clone_url":"https://github.com/plotly/python-api.git","svn_url":"https://github.com/plotly/python-api","homepage":"https://plot.ly/python/","size":7640,"stargazers_count":211,"watchers_count":211,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":64,"mirror_url":null,"open_issues_count":63,"forks":64,"open_issues":63,"watchers":211,"default_branch":"master"}},"base":{"label":"plotly:master","ref":"master","sha":"9130823a4f89edf6ab68e1b3083fc0e5f2b6f788","user":{"login":"plotly","id":5997976,"avatar_url":"https://avatars.githubusercontent.com/u/5997976?v=3","gravatar_id":"","url":"https://api.github.com/users/plotly","html_url":"https://github.com/plotly","followers_url":"https://api.github.com/users/plotly/followers","following_url":"https://api.github.com/users/plotly/following{/other_user}","gists_url":"https://api.github.com/users/plotly/gists{/gist_id}","starred_url":"https://api.github.com/users/plotly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/plotly/subscriptions","organizations_url":"https://api.github.com/users/plotly/orgs","repos_url":"https://api.github.com/users/plotly/repos","events_url":"https://api.github.com/users/plotly/events{/privacy}","received_events_url":"https://api.github.com/users/plotly/received_events","type":"Organization","site_admin":false},"repo":{"id":14579099,"name":"python-api","full_name":"plotly/python-api","owner":{"login":"plotly","id":5997976,"avatar_url":"https://avatars.githubusercontent.com/u/5997976?v=3","gravatar_id":"","url":"https://api.github.com/users/plotly","html_url":"https://github.com/plotly","followers_url":"https://api.github.com/users/plotly/followers","following_url":"https://api.github.com/users/plotly/following{/other_user}","gists_url":"https://api.github.com/users/plotly/gists{/gist_id}","starred_url":"https://api.github.com/users/plotly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/plotly/subscriptions","organizations_url":"https://api.github.com/users/plotly/orgs","repos_url":"https://api.github.com/users/plotly/repos","events_url":"https://api.github.com/users/plotly/events{/privacy}","received_events_url":"https://api.github.com/users/plotly/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/plotly/python-api","description":"Python-API for beautiful, interactive, & shareable graphs ","fork":false,"url":"https://api.github.com/repos/plotly/python-api","forks_url":"https://api.github.com/repos/plotly/python-api/forks","keys_url":"https://api.github.com/repos/plotly/python-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/plotly/python-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/plotly/python-api/teams","hooks_url":"https://api.github.com/repos/plotly/python-api/hooks","issue_events_url":"https://api.github.com/repos/plotly/python-api/issues/events{/number}","events_url":"https://api.github.com/repos/plotly/python-api/events","assignees_url":"https://api.github.com/repos/plotly/python-api/assignees{/user}","branches_url":"https://api.github.com/repos/plotly/python-api/branches{/branch}","tags_url":"https://api.github.com/repos/plotly/python-api/tags","blobs_url":"https://api.github.com/repos/plotly/python-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/plotly/python-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/plotly/python-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/plotly/python-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/plotly/python-api/statuses/{sha}","languages_url":"https://api.github.com/repos/plotly/python-api/languages","stargazers_url":"https://api.github.com/repos/plotly/python-api/stargazers","contributors_url":"https://api.github.com/repos/plotly/python-api/contributors","subscribers_url":"https://api.github.com/repos/plotly/python-api/subscribers","subscription_url":"https://api.github.com/repos/plotly/python-api/subscription","commits_url":"https://api.github.com/repos/plotly/python-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/plotly/python-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/plotly/python-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/plotly/python-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/plotly/python-api/contents/{+path}","compare_url":"https://api.github.com/repos/plotly/python-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/plotly/python-api/merges","archive_url":"https://api.github.com/repos/plotly/python-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/plotly/python-api/downloads","issues_url":"https://api.github.com/repos/plotly/python-api/issues{/number}","pulls_url":"https://api.github.com/repos/plotly/python-api/pulls{/number}","milestones_url":"https://api.github.com/repos/plotly/python-api/milestones{/number}","notifications_url":"https://api.github.com/repos/plotly/python-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/plotly/python-api/labels{/name}","releases_url":"https://api.github.com/repos/plotly/python-api/releases{/id}","created_at":"2013-11-21T05:53:08Z","updated_at":"2015-08-09T07:13:33Z","pushed_at":"2015-08-11T22:39:50Z","git_url":"git://github.com/plotly/python-api.git","ssh_url":"git@github.com:plotly/python-api.git","clone_url":"https://github.com/plotly/python-api.git","svn_url":"https://github.com/plotly/python-api","homepage":"https://plot.ly/python/","size":7640,"stargazers_count":211,"watchers_count":211,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":64,"mirror_url":null,"open_issues_count":63,"forks":64,"open_issues":63,"watchers":211,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/plotly/python-api/pulls/264"},"html":{"href":"https://github.com/plotly/python-api/pull/264"},"issue":{"href":"https://api.github.com/repos/plotly/python-api/issues/264"},"comments":{"href":"https://api.github.com/repos/plotly/python-api/issues/264/comments"},"review_comments":{"href":"https://api.github.com/repos/plotly/python-api/pulls/264/comments"},"review_comment":{"href":"https://api.github.com/repos/plotly/python-api/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/plotly/python-api/pulls/264/commits"},"statuses":{"href":"https://api.github.com/repos/plotly/python-api/statuses/85610b48b0e1dc14a6d157d5bf1d26c79b25b230"}}}}