File tree Expand file tree Collapse file tree 2 files changed +7
-12
lines changed
Filter options
tests/test_core/test_graph_reference Expand file tree Collapse file tree 2 files changed +7
-12
lines changed
Original file line number Diff line number Diff line change 9
9
from pkg_resources import resource_string
10
10
from unittest import TestCase
11
11
12
- import requests
13
- import six
14
12
from nose .plugins .attrib import attr
15
13
16
- from plotly import files , graph_reference as gr
14
+ from plotly import graph_reference as gr
15
+ from plotly .api import v2
17
16
from plotly .graph_reference import string_to_class_name , get_role
18
17
from plotly .tests .utils import PlotlyTestCase
19
18
19
+ FAKE_API_DOMAIN = 'https://api.am.not.here.ly'
20
+
20
21
21
22
class TestGraphReferenceCaching (PlotlyTestCase ):
22
23
@@ -32,14 +33,8 @@ def test_get_graph_reference(self):
32
33
33
34
@attr ('slow' )
34
35
def test_default_schema_is_up_to_date (self ):
35
- api_domain = files .FILE_CONTENT [files .CONFIG_FILE ]['plotly_api_domain' ]
36
- graph_reference_url = '{}{}?sha1' .format (api_domain , '/v2/plot-schema' )
37
- response = requests .get (graph_reference_url )
38
- if six .PY3 :
39
- content = str (response .content , encoding = 'utf-8' )
40
- else :
41
- content = response .content
42
- schema = json .loads (content )['schema' ]
36
+ response = v2 .plot_schema .retrieve ('' )
37
+ schema = response .json ()['schema' ]
43
38
44
39
path = os .path .join ('package_data' , 'default-schema.json' )
45
40
s = resource_string ('plotly' , path ).decode ('utf-8' )
Original file line number Diff line number Diff line change 19
19
from plotly import colors
20
20
from plotly import utils
21
21
from plotly import exceptions
22
- from plotly import graph_reference
23
22
from plotly import session
24
23
from plotly .files import (CONFIG_FILE , CREDENTIALS_FILE , FILE_CONTENT ,
25
24
check_file_permissions )
@@ -1357,6 +1356,7 @@ def validate(obj, obj_type):
1357
1356
1358
1357
"""
1359
1358
# TODO: Deprecate or move. #283
1359
+ from plotly import graph_reference
1360
1360
from plotly .graph_objs import graph_objs
1361
1361
1362
1362
if obj_type not in graph_reference .CLASSES :
You can’t perform that action at this time.
0 commit comments