From 1e2679f5f6116bfda7fd31f86d5d8ad9ed5943ad Mon Sep 17 00:00:00 2001 From: Andrew Seier Date: Tue, 23 Sep 2014 22:49:03 -0700 Subject: [PATCH] Currently, username matches are case SENSITIVE (not sure why). Might as well make our tested usernames exact matches. --- .../test_get_figure/test_get_figure.py | 22 +++++++++---------- .../test_get_requests/test_get_requests.py | 8 +++---- .../tests/test_core/test_plotly/test_plot.py | 4 ++-- .../test_core/test_stream/test_stream.py | 2 +- .../test_optional/test_ipython/test_embed.py | 2 +- 5 files changed, 19 insertions(+), 19 deletions(-) diff --git a/plotly/tests/test_core/test_get_figure/test_get_figure.py b/plotly/tests/test_core/test_get_figure/test_get_figure.py index 48b067bf90f..5e2af8bafd0 100644 --- a/plotly/tests/test_core/test_get_figure/test_get_figure.py +++ b/plotly/tests/test_core/test_get_figure/test_get_figure.py @@ -91,17 +91,17 @@ def is_trivial(obj): def test_get_figure(): - un = 'plotlyimagetest' + un = 'PlotlyImageTest' ak = '786r5mecv0' file_id = 2 py.sign_in(un, ak) print("getting: https://plot.ly/~{0}/{1}/".format(un, file_id)) print("###########################################\n\n") - fig = py.get_figure('plotlyimagetest', str(file_id)) + fig = py.get_figure('PlotlyImageTest', str(file_id)) def test_get_figure_with_url(): - un = 'plotlyimagetest' + un = 'PlotlyImageTest' ak = '786r5mecv0' url = "https://plot.ly/~PlotlyImageTest/2/" py.sign_in(un, ak) @@ -112,7 +112,7 @@ def test_get_figure_with_url(): @raises(exceptions.PlotlyError) def test_get_figure_invalid_1(): - un = 'plotlyimagetest' + un = 'PlotlyImageTest' ak = '786r5mecv0' url = "https://plot.ly/~PlotlyImageTest/a/" py.sign_in(un, ak) @@ -123,7 +123,7 @@ def test_get_figure_invalid_1(): @raises(exceptions.PlotlyError) def test_get_figure_invalid_2(): - un = 'plotlyimagetest' + un = 'PlotlyImageTest' ak = '786r5mecv0' url = "https://plot.ly/~PlotlyImageTest/-1/" py.sign_in(un, ak) @@ -134,7 +134,7 @@ def test_get_figure_invalid_2(): @raises(exceptions.PlotlyError) def test_get_figure_does_not_exist(): - un = 'plotlyimagetest' + un = 'PlotlyImageTest' ak = '786r5mecv0' url = "https://plot.ly/~PlotlyImageTest/1000000000/" py.sign_in(un, ak) @@ -144,17 +144,17 @@ def test_get_figure_does_not_exist(): def test_get_figure_raw(): - un = 'plotlyimagetest' + un = 'PlotlyImageTest' ak = '786r5mecv0' file_id = 2 py.sign_in(un, ak) print("getting: https://plot.ly/~{0}/{1}/".format(un, file_id)) print("###########################################\n\n") - fig = py.get_figure('plotlyimagetest', str(file_id), raw=True) + fig = py.get_figure('PlotlyImageTest', str(file_id), raw=True) def test_all(): - un = 'plotlyimagetest' + un = 'PlotlyImageTest' ak = '786r5mecv0' run_test = False end_file = 2 @@ -173,8 +173,8 @@ def test_all(): try: print("testing: https://plot.ly/~{0}/{1}".format(un, file_id)) print("###########################################\n\n") - fig = py.get_figure('plotlyimagetest', str(file_id)) - fig_raw = py.get_figure('plotlyimagetest', + fig = py.get_figure('PlotlyImageTest', str(file_id)) + fig_raw = py.get_figure('PlotlyImageTest', str(file_id), raw=True) except exceptions.PlotlyError: diff --git a/plotly/tests/test_core/test_get_requests/test_get_requests.py b/plotly/tests/test_core/test_get_requests/test_get_requests.py index b312a9ddcf4..f76fd640fa8 100644 --- a/plotly/tests/test_core/test_get_requests/test_get_requests.py +++ b/plotly/tests/test_core/test_get_requests/test_get_requests.py @@ -46,7 +46,7 @@ def test_user_does_not_exist(): def test_file_does_not_exist(): - username = 'plotlyimagetest' + username = 'PlotlyImageTest' api_key = '786r5mecv0' file_owner = 'get_test_user' file_id = 1000 @@ -67,7 +67,7 @@ def test_file_does_not_exist(): def test_wrong_api_key(): # TODO: does this test the right thing? - username = 'plotlyimagetest' + username = 'PlotlyImageTest' api_key = 'invalid-apikey' file_owner = 'get_test_user' file_id = 0 @@ -84,7 +84,7 @@ def test_wrong_api_key(): # TODO: does this test the right thing? # TODO def test_private_permission_defined(): - username = 'plotlyimagetest' + username = 'PlotlyImageTest' api_key = '786r5mecv0' file_owner = 'get_test_user' file_id = 1 # 1 is a private file @@ -124,7 +124,7 @@ def test_missing_headers(): def test_valid_request(): - username = 'plotlyimagetest' + username = 'PlotlyImageTest' api_key = '786r5mecv0' file_owner = 'get_test_user' file_id = 0 diff --git a/plotly/tests/test_core/test_plotly/test_plot.py b/plotly/tests/test_core/test_plotly/test_plot.py index 3c9a93969db..d08e85bbc16 100644 --- a/plotly/tests/test_core/test_plotly/test_plot.py +++ b/plotly/tests/test_core/test_plotly/test_plot.py @@ -13,12 +13,12 @@ from plotly.exceptions import PlotlyError -# username for tests: 'plotlyimagetest' +# username for tests: 'PlotlyImageTest' # api_key for account: '786r5mecv0' def test_plot_valid(): - py.sign_in('plotlyimagetest', '786r5mecv0') + py.sign_in('PlotlyImageTest', '786r5mecv0') fig = { 'data':[ { diff --git a/plotly/tests/test_core/test_stream/test_stream.py b/plotly/tests/test_core/test_stream/test_stream.py index 624c6ef96fb..47ed59e5f58 100644 --- a/plotly/tests/test_core/test_stream/test_stream.py +++ b/plotly/tests/test_core/test_stream/test_stream.py @@ -13,7 +13,7 @@ import plotly.plotly as py from plotly import exceptions -un = 'pythonapi' +un = 'PythonAPI' ak = 'ubpiol2cve' tk = 'vaia8trjjb' diff --git a/plotly/tests/test_optional/test_ipython/test_embed.py b/plotly/tests/test_optional/test_ipython/test_embed.py index 45876265675..417f0c9babc 100644 --- a/plotly/tests/test_optional/test_ipython/test_embed.py +++ b/plotly/tests/test_optional/test_ipython/test_embed.py @@ -15,7 +15,7 @@ class TestPlotlyDisplay(unittest.TestCase): def setUp(self): - plot_info = {"un": "plotlyimagetest", "fid": "2"} + plot_info = {"un": "PlotlyImageTest", "fid": "2"} url = "https://plot.ly/~{un}/{fid}".format(**plot_info) self.display_obj = tls.embed(url) self.results = {}