File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
packages/python/plotly/plotly/tests Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change 12
12
13
13
import plotly
14
14
import plotly .io as pio
15
+ from plotly .tests .utils import plotly_cdn_url
16
+
15
17
import json
16
18
17
19
packages_root = os .path .dirname (
39
41
<script type="text/javascript">\
40
42
window.PlotlyConfig = {MathJaxConfig: 'local'};</script>"""
41
43
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 ())
43
45
44
46
directory_script = '<script src="plotly.min.js"></script>'
45
47
Original file line number Diff line number Diff line change 11
11
import plotly .graph_objs as go
12
12
import plotly .io as pio
13
13
from plotly .offline import get_plotlyjs
14
+ from plotly .tests .utils import plotly_cdn_url
14
15
15
16
if sys .version_info >= (3 , 3 ):
16
17
import unittest .mock as mock
@@ -135,7 +136,7 @@ def assert_not_full_html(html):
135
136
136
137
137
138
def assert_connected (html ):
138
- assert "https://cdn.plot.ly/plotly-latest.min" in html
139
+ assert plotly_cdn_url () in html
139
140
140
141
141
142
def assert_offline (html ):
@@ -306,7 +307,7 @@ def test_repr_html(renderer):
306
307
template = (
307
308
'<div> <script type="text/javascript">'
308
309
"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> '
310
311
'<div id="cd462b94-79ce-42a2-887f-2650a761a144" class="plotly-graph-div" '
311
312
'style="height:100%; width:100%;"></div> <script type="text/javascript">'
312
313
" window.PLOTLYENV=window.PLOTLYENV || {};"
You can’t perform that action at this time.
0 commit comments