8000 Test fixes 2 by Kully · Pull Request #994 · plotly/plotly.py · GitHub
[go: up one dir, main page]

Skip to content

Test fixes 2 #994

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 28 commits into from
May 7, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
3cef6d3
remove get_data, strip_style and to_string test files
Kully Apr 23, 2018
ce3b723
fixed test_frames
Kully Apr 23, 2018
7378270
test_data working
Kully Apr 23, 2018
fbdcb62
remove test_graph_objs_tools as graph_objs_tools doesn't exist
Kully Apr 23, 2018
39d036d
move strip_dict_params to plotly/test/utils.py
Kully Apr 23, 2018
53bcdec
fixed most of test_update
Kully Apr 24, 2018
c88ef40
Merge branch 'ipyplotly_integration' into test-fixes-2
Kully Apr 24, 2018
75b0ffc
Merge branch 'ipyplotly_integration' of https://github.com/plotly/plo…
Kully Apr 25, 2018
c2821a6
all test_core tests passing (sans streaming tests)
Kully Apr 26, 2018
f7c75cc
removed graph_objs as only to_dataframe is there - unsupported method…
Kully Apr 26, 2018
c228895
test_core tests working sans matplotlylib datatypes stuff
Kully Apr 26, 2018
22f15c0
update axis scales
Kully Apr 26, 2018
57a56aa
scatter - fixed test_scatter
Kully Apr 27, 2018
0fc2727
working on matplotlylib...
Kully Apr 30, 2018
6f8dcf4
convert dashed to dash in matplotlylib tools // fix test_lines
Kully Apr 30, 2018
20ecb25
test_date_times
Kully Apr 30, 2018
f024f57
fixed test_bars
Kully Apr 30, 2018
47622f5
remove commented x=... line
Kully Apr 30, 2018
< 8000 code class="float-right">390c4f2
axis_scales
Kully May 1, 2018
6d5dd92
annotations
Kully May 1, 2018
f70202d
subplots in matplotlylib
Kully May 1, 2018
6455837
fixed all streaming tests w/o server error to interupt \n playing wit…
Kully May 1, 2018
0fedc1b
working on using admin buildly account
Kully May 1, 2018
6ed70db
corrected coerce stream trace to dict if BaseTraceType line
Kully May 2, 2018
c891d75
mid stream write validation error
Kully May 2, 2018
77ca1b2
move print statements around
Kully May 2, 2018
f09a5ec
fixed streaming tests//no validation within stream.write
Kully May 2, 2018
0b5a98c
remove print statement
Kully May 2, 2018
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
Prev Previous commit
Next Next commit
all test_core tests passing (sans streaming tests)
  • Loading branch information
Kully committed Apr 26, 2018
commit c2821a6b354a67dd005fcb89252391f2ebb762ed
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import sys
from unittest import TestCase

import plotly.graph_objs as go

if sys.version_info.major == 3 and sys.version_info.minor >= 3:
from unittest.mock import MagicMock
else:
from mock import MagicMock


class TestAddTracesMessage(TestCase):
def setUp(self):
# Construct initial scatter object
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import sys
from unittest import TestCase

import plotly.graph_objs as go

if sys.version_info.major == 3 and sys.version_info.minor >= 3:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import sys
from unittest import TestCase
import plotly.graph_objs as go
from nose.tools import raises

import plotly.graph_objs as go

if sys.version_info.major == 3 and sys.version_info.minor >= 3:
from unittest.mock import MagicMock
else:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import sys
from unittest import TestCase
import plotly.graph_objs as go
from nose.tools import raises

import plotly.graph_objs as go

if sys.version_info.major == 3 and sys.version_info.minor >= 3:
from unittest.mock import MagicMock
else:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import sys
from unittest import TestCase
from nose.tools import raises

import plotly.graph_objs as go

if sys.version_info.major == 3 and sys.version_info.minor >= 3:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import sys
from unittest import TestCase
from nose.tools import raises

import plotly.graph_objs as go

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import sys
from unittest import TestCase
from nose.tools import raises

import plotly.graph_objs as go
from plotly.basedatatypes import Undefined
Expand Down
11 changes: 1 addition & 10 deletions plotly/tests/test_core/test_graph_objs/test_update.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from __future__ import absolute_import
from unittest import skip

from plotly.graph_objs import Data, Figure, Layout, Line, Scatter, XAxis
from plotly.graph_objs import Data, Figure, Layout, Line, Scatter, scatter, XAxis
from plotly.tests.utils import strip_dict_params


Expand Down Expand Up @@ -58,12 +58,3 @@ def test_update_list_make_copies_false():
update = dict(x=[2, 3, 4], y=[1, 2, 3], line=Line())
data.update(update, make_copies=False)
assert data[0]['line'] is data[1]['line']


def test_update_list_make_copies_true():
trace1 = Scatter(x=[1, 2, 3], y=[2, 1, 2])
trace2 = Scatter(x=[1, 2, 3], y=[3, 2, 1])
data = Data([trace1, trace2])
update = dict(x=[2, 3, 4], y=[1, 2, 3], line=Line())
data.update(update, make_copies=True)
assert data[0]['line'] is not data[1]['line']
6 changes: 3 additions & 3 deletions plotly/tests/test_core/test_grid/test_grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def test_row_append(self):
@attr('slow')
def test_plot_from_grid(self):
g = self.upload_and_return_grid()
url = py.plot([Scatter(xsrc=g[0], ysrc=g[1])],
url = py.plot([Scatter(xsrc=g[0].id, ysrc=g[1].id)],
auto_open=False, filename='plot from grid')
return url, g

Expand All @@ -103,8 +103,8 @@ def test_get_figure_from_references(self):
fig = py.get_figure(url)
data = fig['data']
trace = data[0]
assert(g[0].data == trace['x'])
assert(g[1].data == trace['y'])
assert(tuple(g[0].data) == tuple(trace['x']))
assert(tuple(g[1].data) == tuple(trace['y']))

def test_grid_id_args(self):
self.assertEqual(parse_grid_id_args(self._grid, None),
Expand Down
7 changes: 4 additions & 3 deletions plotly/tests/test_core/test_offline/test_offline.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from __future__ import absolute_import

import os
import re
from unittest import TestCase

from requests.compat import json as _json
Expand Down Expand Up @@ -45,8 +46,8 @@ def _read_html(self, file_url):
return f.read()

def test_default_plot_generates_expected_html(self):
data_json = _json.dumps(fig['data'],
cls=plotly.utils.PlotlyJSONEncoder)
# add uid to data_json for regex search
data_json = '\[\{"x": \[1, 2, 3\], "y": \[10, 20, 30\], "type": "scatter", "uid": .+\}\]'
layout_json = _json.dumps(
fig['layout'],
cls=plotly.utils.PlotlyJSONEncoder)
Expand All @@ -56,7 +57,7 @@ def test_default_plot_generates_expected_html(self):
# I don't really want to test the entire script output, so
# instead just make sure a few of the parts are in here?
self.assertIn('Plotly.newPlot', html) # plot command is in there
self.assertIn(data_json, html) # data is in there
self.assertTrue(re.search(data_json, html)) # data is in there
self.assertIn(layout_json, html) # so is layout
self.assertIn(PLOTLYJS, html) # and the source code
# and it's an <html> doc
Expand Down
2 changes: 1 addition & 1 deletion plotly/tests/test_core/test_plotly/test_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

import requests
import six
import sys
from requests.compat import json as _json

from nose.plugins.attrib import attr
Expand All @@ -20,7 +21,6 @@
from plotly.exceptions import PlotlyError, PlotlyEmptyDataError
from plotly.files import CONFIG_FILE

import sys

# import from mock
if sys.version_info.major == 3 and sys.version_info.minor >= 3:
Expand Down
12 changes: 6 additions & 6 deletions plotly/tests/test_core/test_tools/test_make_subplots.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from unittest import TestCase

from plotly.graph_objs import (Annotation, Annotations, Data, Figure, Font,
Layout, Scene, XAxis, YAxis)
Layout, layout, Scene, XAxis, YAxis)
import plotly.tools as tls


Expand Down Expand Up @@ -144,19 +144,19 @@ def test_two_row_bottom_left(self):
expected = Figure(
data=Data(),
layout=Layout(
xaxis1=XAxis(
xaxis1=layout.XAxis(
domain=[0.0, 1.0],
anchor='y'
),
xaxis2=XAxis(
xaxis2=layout.XAxis(
domain=[0.0, 1.0],
anchor='y2'
),
yaxis1=YAxis(
domain=[0.575, 1.0],
yaxis1=layout.YAxis(
domain=[0.0, 0.425],
anchor='x'
),
yaxis2=YAxis(
yaxis2=layout.YAxis(
domain=[0.575, 1.0],
anchor='x2'
),
Expand Down
0