Skip to content

Commit cf89883

Browse files
committed
signin with plotly test case
1 parent 9b589cb commit cf89883

File tree

1 file changed

+33
-38
lines changed

1 file changed

+33
-38
lines changed

plotly/tests/test_core/test_plotly/test_plot.py

Lines changed: 33 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -25,52 +25,47 @@
2525
# api_key for account: '786r5mecv0'
2626

2727

28-
@attr('slow')
29-
def test_plot_valid():
30-
fig = {
31-
'data': [
32-
{
33-
'x': [1, 2, 3],
34-
'y': [2, 1, 2]
35-
}
36-
]
37-
}
38-
py.plot(fig, auto_open=False, filename='plot_valid')
39-
40-
41-
@raises(PlotlyError)
42-
def test_plot_invalid():
43-
fig = {
44-
'data': [
45-
{
46-
'x': [1, 2, 3],
47-
'y': [2, 1, 2],
48-
'z': [3, 4, 1]
49-
}
50-
]
51-
}
52-
py.plot(fig, auto_open=False, filename='plot_invalid')
53-
54-
55-
@raises(TypeError)
56-
def test_plot_invalid_args_1():
57-
py.plot(x=[1, 2, 3], y=[2, 1, 2], auto_open=False, filename='plot_invalid')
58-
59-
60-
@raises(PlotlyError)
61-
def test_plot_invalid_args_2():
62-
py.plot([1, 2, 3], [2, 1, 2], auto_open=False, filename='plot_invalid')
63-
64-
6528
class TestPlot(TestCase):
6629
def setUp(self):
6730
py.sign_in('PlotlyImageTest', '786r5mecv0',
6831
plotly_domain='https://plot.ly')
6932
self.simple_figure = {'data': [{'x': [1, 2, 3], 'y': [2, 1, 2]}]}
7033
super(TestPlot, self).setUp()
7134

35+
@attr('slow')
36+
def test_plot_valid(self):
37+
fig = {
38+
'data': [
39+
{
40+
'x': [1, 2, 3],
41+
'y': [2, 1, 2]
42+
}
43+
]
44+
}
45+
py.plot(fig, auto_open=False, filename='plot_valid')
46+
47+
@raises(PlotlyError)
48+
def test_plot_invalid(self):
49+
fig = {
50+
'data': [
51+
{
52+
'x': [1, 2, 3],
53+
'y': [2, 1, 2],
54+
'z': [3, 4, 1]
55+
}
56+
]
57+
}
58+
py.plot(fig, auto_open=False, filename='plot_invalid')
59+
60+
@raises(TypeError)
61+
def test_plot_invalid_args_1(self):
62+
py.plot(x=[1, 2, 3], y=[2, 1, 2], auto_open=False, filename='plot_invalid')
63+
64+
@raises(PlotlyError)
65+
def test_plot_invalid_args_2(self):
66+
py.plot([1, 2, 3], [2, 1, 2], auto_open=False, filename='plot_invalid')
67+
7268
def test_plot_empty_data(self):
73-
py.sign_in('PlotlyImageTest', '786r5mecv0')
7469
self.assertRaises(PlotlyEmptyDataError, py.plot, [],
7570
filename='plot_invalid')
7671

0 commit comments

Comments
 (0)