Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 61a1e01

Browse filesBrowse files
committed
Use api.v2.plot_schema to get GRAPH_REFERENCE.
There is a circular import issue that needed to be fixed here as well.
1 parent de51cd8 commit 61a1e01
Copy full SHA for 61a1e01

File tree

Expand file treeCollapse file tree

2 files changed

+7
-12
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+7
-12
lines changed

‎plotly/tests/test_core/test_graph_reference/test_graph_reference.py

Copy file name to clipboardExpand all lines: plotly/tests/test_core/test_graph_reference/test_graph_reference.py
+6-11Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,15 @@
99
from pkg_resources import resource_string
1010
from unittest import TestCase
1111

12-
import requests
13-
import six
1412
from nose.plugins.attrib import attr
1513

16-
from plotly import files, graph_reference as gr
14+
from plotly import graph_reference as gr
15+
from plotly.api import v2
1716
from plotly.graph_reference import string_to_class_name, get_role
1817
from plotly.tests.utils import PlotlyTestCase
1918

19+
FAKE_API_DOMAIN = 'https://api.am.not.here.ly'
20+
2021

2122
class TestGraphReferenceCaching(PlotlyTestCase):
2223

@@ -32,14 +33,8 @@ def test_get_graph_reference(self):
3233

3334
@attr('slow')
3435
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']
4338

4439
path = os.path.join('package_data', 'default-schema.json')
4540
s = resource_string('plotly', path).decode('utf-8')

‎plotly/tools.py

Copy file name to clipboardExpand all lines: plotly/tools.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
from plotly import colors
2020
from plotly import utils
2121
from plotly import exceptions
22-
from plotly import graph_reference
2322
from plotly import session
2423
from plotly.files import (CONFIG_FILE, CREDENTIALS_FILE, FILE_CONTENT,
2524
check_file_permissions)
@@ -1357,6 +1356,7 @@ def validate(obj, obj_type):
13571356
13581357
"""
13591358
# TODO: Deprecate or move. #283
1359+
from plotly import graph_reference
13601360
from plotly.graph_objs import graph_objs
13611361

13621362
if obj_type not in graph_reference.CLASSES:

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.