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

Add a test to force us to update default schema! #307

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 29, 2015
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add a test to force us to update default schema!
  • Loading branch information
theengineear committed Sep 29, 2015
commit 174647780a4ace954bb1e425777e66a3c5bbdfab
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from pkg_resources import resource_string
from unittest import TestCase

import requests
from nose.plugins.attrib import attr

from plotly import files, graph_reference as gr, tools, utils
Expand Down Expand Up @@ -57,6 +58,25 @@ def test_get_graph_reference_bad_request_no_copy(self):
graph_reference = gr.get_graph_reference()
self.assertEqual(graph_reference, default_graph_reference)

@attr('slow')
def test_default_schema_is_up_to_date(self):
api_domain = files.FILE_CONTENT[files.CONFIG_FILE]['plotly_api_domain']
graph_reference_url = '{}{}?sha1'.format(api_domain,
gr.GRAPH_REFERENCE_PATH)
response = requests.get(graph_reference_url)
schema = json.loads(response.content)['schema']

path = os.path.join('graph_reference', 'default-schema.json')
s = resource_string('plotly', path).decode('utf-8')
default_schema = json.loads(s)

msg = (
'The default, hard-coded plot schema we ship with pip is out of '
'sync with the prod plot schema!\n'
'Run `make update_default_schema` to fix it!'
)
self.assertEqual(schema, default_schema, msg=msg)


class TestStringToClass(PlotlyTestCase):

Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.