Skip to content

Commit 4df4528

Browse files
committed
rewrote test
1 parent cecaf60 commit 4df4528

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

plotly/tests/test_core/test_offline/test_offline.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
from nose.tools import raises
88
from unittest import TestCase
9+
from plotly.tests.utils import PlotlyTestCase
910
import json
1011

1112
import plotly
@@ -21,6 +22,7 @@
2122

2223
PLOTLYJS = plotly.offline.offline.get_plotlyjs()
2324

25+
2426
class PlotlyOfflineTestCase(TestCase):
2527
def setUp(self):
2628
pass
@@ -79,11 +81,22 @@ def test_autoresizing(self):
7981
for resize_code_string in resize_code_strings:
8082
self.assertTrue(resize_code_string not in html)
8183

82-
def test_plot_rendered_if_non_plotly_domain(self):
84+
85+
class PlotlyOfflineOtherDomainTestCase(PlotlyTestCase):
86+
def setUp(self):
87+
super(PlotlyOfflineOtherDomainTestCase, self).setUp()
8388
plotly.tools.set_config_file(plotly_domain='https://stage.plot.ly',
8489
plotly_api_domain='https://api-stage.plot.ly')
90+
plotly.plotly.sign_in('PlotlyTestShark', 'kI2H0E7sTZ5RM9yoaK4X')
8591

92+
def test_plot_rendered_if_non_plotly_domain(self):
8693
html = plotly.offline.plot(fig, output_type='div')
94+
8795
# test that 'Export to stage.plot.ly' is in the html
8896
self.assertTrue('Export to stage.plot.ly' in html)
89-
self.assertTrue('Export to plot.ly' not in html)
97+
98+
def tearDown(self):
99+
plotly.tools.set_config_file(plotly_domain='https://plot.ly',
100+
plotly_api_domain='https://api.plot.ly')
101+
plotly.plotly.sign_in('PythonTest', '9v9f20pext')
102+
super(PlotlyOfflineOtherDomainTestCase, self).tearDown()

0 commit comments

Comments
 (0)