Skip to content

Commit 49a777d

Browse files
committed
fix other tests that are broken by new 'cdn' option behaviour
1 parent 3ed5058 commit 49a777d

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

packages/python/plotly/plotly/tests/test_core/test_offline/test_offline.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212

1313
import plotly
1414
import plotly.io as pio
15+
from plotly.tests.utils import plotly_cdn_url
16+
1517
import json
1618

1719
packages_root = os.path.dirname(
@@ -39,7 +41,7 @@
3941
<script type="text/javascript">\
4042
window.PlotlyConfig = {MathJaxConfig: 'local'};</script>"""
4143

42-
cdn_script = '<script src="https://cdn.plot.ly/plotly-latest.min.js">' "</script>"
44+
cdn_script = '<script src="{cdn_url}"></script>'.format(cdn_url=plotly_cdn_url())
4345

4446
directory_script = '<script src="plotly.min.js"></script>'
4547

packages/python/plotly/plotly/tests/test_io/test_renderers.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import plotly.graph_objs as go
1212
import plotly.io as pio
1313
from plotly.offline import get_plotlyjs
14+
from plotly.tests.utils import plotly_cdn_url
1415

1516
if sys.version_info >= (3, 3):
1617
import unittest.mock as mock
@@ -135,7 +136,7 @@ def assert_not_full_html(html):
135136

136137

137138
def assert_connected(html):
138-
assert "https://cdn.plot.ly/plotly-latest.min" in html
139+
assert plotly_cdn_url() in html
139140

140141

141142
def assert_offline(html):
@@ -306,7 +307,7 @@ def test_repr_html(renderer):
306307
template = (
307308
'<div> <script type="text/javascript">'
308309
"window.PlotlyConfig = {MathJaxConfig: 'local'};</script>\n "
309-
'<script src="https://cdn.plot.ly/plotly-latest.min.js"></script> '
310+
'<script src="' + plotly_cdn_url() + '"></script> '
310311
'<div id="cd462b94-79ce-42a2-887f-2650a761a144" class="plotly-graph-div" '
311312
'style="height:100%; width:100%;"></div> <script type="text/javascript">'
312313
" window.PLOTLYENV=window.PLOTLYENV || {};"

0 commit comments

Comments
 (0)