Skip to content

deactivating all streaming tests #967

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

Closed
wants to merge 2 commits into from
Closed
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
deactivating all streaming tests
  • Loading branch information
Kully committed Mar 9, 2018
commit 21173f2dc93812d428b677b7eef2f8357594249e
287 changes: 144 additions & 143 deletions plotly/tests/test_core/test_stream/test_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,164 +22,165 @@
'plotly_ssl_verification': False}


class TestStreaming(PlotlyTestCase):

def setUp(self):
super(TestStreaming, self).setUp()
py.sign_in(un, ak, **config)

@attr('slow')
def test_initialize_stream_plot(self):
py.sign_in(un, ak)
stream = Stream(token=tk, maxpoints=50)
url = py.plot([Scatter(x=[], y=[], mode='markers', stream=stream)],
auto_open=False,
world_readable=True,
filename='stream-test')
assert url == 'https://plot.ly/~PythonAPI/461'
time.sleep(.5)

@attr('slow')
def test_stream_single_points(self):
py.sign_in(un, ak)
stream = Stream(token=tk, maxpoints=50)
res = py.plot([Scatter(x=[], y=[], mode='markers', stream=stream)],
auto_open=False,
world_readable=True,
filename='stream-test')
time.sleep(.5)
my_stream = py.Stream(tk)
my_stream.open()
my_stream.write(Scatter(x=1, y=10))
time.sleep(.5)
my_stream.close()

@attr('slow')
def test_stream_multiple_points(self):
py.sign_in(un, ak)
stream = Stream(token=tk, maxpoints=50)
url = py.plot([Scatter(x=[], y=[], mode='markers', stream=stream)],
auto_open=False,
world_readable=True,
filename='stream-test')
time.sleep(.5)
my_stream = py.Stream(tk)
my_stream.open()
my_stream.write(Scatter(x=[1, 2, 3, 4], y=[2, 1, 2, 5]))
time.sleep(.5)
my_stream.close()

@attr('slow')
def test_stream_layout(self):
py.sign_in(un, ak)
stream = Stream(token=tk, maxpoints=50)
url = py.plot([Scatter(x=[], y=[], mode='markers', stream=stream)],
auto_open=False,
world_readable=True,
filename='stream-test')
time.sleep(.5)
title_0 = "some title i picked first"
title_1 = "this other title i picked second"
my_stream = py.Stream(tk)
my_stream.open()
my_stream.write(Scatter(x=1, y=10), layout=Layout(title=title_0))
time.sleep(.5)
my_stream.close()
my_stream.open()
my_stream.write(Scatter(x=1, y=10), layout=Layout(title=title_1))
my_stream.close()

@attr('slow')
def test_stream_validate_data(self):
with self.assertRaises(exceptions.PlotlyError):
if False:
class TestStreaming(PlotlyTestCase):

def setUp(self):
super(TestStreaming, self).setUp()
py.sign_in(un, ak, **config)

@attr('slow')
def test_initialize_stream_plot(self):
py.sign_in(un, ak)
stream = Stream(token=tk, maxpoints=50)
url = py.plot([Scatter(x=[], y=[], mode='markers', stream=stream)],
auto_open=False,
world_readable=True,
filename='stream-test')
assert url == 'https://plot.ly/~PythonAPI/461'
time.sleep(.5)

@attr('slow')
def test_stream_single_points(self):
py.sign_in(un, ak)
stream = Stream(token=tk, maxpoints=50)
res = py.plot([Scatter(x=[], y=[], mode='markers', stream=stream)],
auto_open=False,
world_readable=True,
filename='stream-test')
time.sleep(.5)
my_stream = py.Stream(tk)
my_stream.open()
my_stream.write(dict(x=1, y=10, z=[1])) # assumes scatter...
my_stream.write(Scatter(x=1, y=10))
time.sleep(.5)
my_stream.close()

@attr('slow')
def test_stream_validate_layout(self):
with self.assertRaises(exceptions.PlotlyError):
@attr('slow')
def test_stream_multiple_points(self):
py.sign_in(un, ak)
stream = Stream(token=tk, maxpoints=50)
url = py.plot([Scatter(x=[], y=[], mode='markers', stream=stream)],
auto_open=False,
world_readable=True,
filename='stream-test')
time.sleep(.5)
my_stream = py.Stream(tk)
my_stream.open()
my_stream.write(Scatter(x=1, y=10), layout=Layout(legend=True))
my_stream.write(Scatter(x=[1, 2, 3, 4], y=[2, 1, 2, 5]))
time.sleep(.5)
my_stream.close()

@attr('slow')
def test_stream_unstreamable(self):
@attr('slow')
def test_stream_layout(self):
py.sign_in(un, ak)
stream = Stream(token=tk, maxpoints=50)
url = py.plot([Scatter(x=[], y=[], mode='markers', stream=stream)],
auto_open=False,
world_readable=True,
filename='stream-test')
time.sleep(.5)
title_0 = "some title i picked first"
title_1 = "this other title i picked second"
my_stream = py.Stream(tk)
my_stream.open()
my_stream.write(Scatter(x=1, y=10), layout=Layout(title=title_0))
time.sleep(.5)
my_stream.close()
my_stream.open()
my_stream.write(Scatter(x=1, y=10), layout=Layout(title=title_1))
my_stream.close()

# even though `name` isn't streamable, we don't validate it --> pass
@attr('slow')
def test_stream_validate_data(self):
with self.assertRaises(exceptions.PlotlyError):
py.sign_in(un, ak)
my_stream = py.Stream(tk)
my_stream.open()
my_stream.write(dict(x=1, y=10, z=[1])) # assumes scatter...
my_stream.close()

@attr('slow')
def test_stream_validate_layout(self):
with self.assertRaises(exceptions.PlotlyError):
py.sign_in(un, ak)
my_stream = py.Stream(tk)
my_stream.open()
my_stream.write(Scatter(x=1, y=10), layout=Layout(legend=True))
my_stream.close()

@attr('slow')
def test_stream_unstreamable(self):

# even though `name` isn't streamable, we don't validate it --> pass

py.sign_in(un, ak)
my_stream = py.Stream(tk)
my_stream.open()
my_stream.write(Scatter(x=1, y=10, name='nope'))
my_stream.close()
py.sign_in(un, ak)
my_stream = py.Stream(tk)
my_stream.open()
my_stream.write(Scatter(x=1, y=10, name='nope'))
my_stream.close()

def test_stream_no_scheme(self):
def test_stream_no_scheme(self):

# If no scheme is used in the plotly_streaming_domain, port 80
# should be used for streaming and ssl_enabled should be False
# If no scheme is used in the plotly_streaming_domain, port 80
# should be used for streaming and ssl_enabled should be False

py.sign_in(un, ak, **{'plotly_streaming_domain': 'stream.plot.ly'})
my_stream = py.Stream(tk)
expected_streaming_specs = {
'server': 'stream.plot.ly',
'port': 80,
'ssl_enabled': False,
'ssl_verification_enabled': False,
'headers': {
'Host': 'stream.plot.ly',
'plotly-streamtoken': tk
py.sign_in(un, ak, **{'plotly_streaming_domain': 'stream.plot.ly'})
my_stream = py.Stream(tk)
expected_streaming_specs = {
'server': 'stream.plot.ly',
'port': 80,
'ssl_enabled': False,
'ssl_verification_enabled': False,
'headers': {
'Host': 'stream.plot.ly',
'plotly-streamtoken': tk
}
}
}
actual_streaming_specs = my_stream.get_streaming_specs()
self.assertEqual(expected_streaming_specs, actual_streaming_specs)

def test_stream_http(self):

# If the http scheme is used in the plotly_streaming_domain, port 80
# should be used for streaming and ssl_enabled should be False

py.sign_in(un, ak,
**{'plotly_streaming_domain': 'http://stream.plot.ly'})
my_stream = py.Stream(tk)
expected_streaming_specs = {
'server': 'stream.plot.ly',
'port': 80,
'ssl_enabled': False,
'ssl_verification_enabled': False,
'headers': {
'Host': 'stream.plot.ly',
'plotly-streamtoken': tk
actual_streaming_specs = my_stream.get_streaming_specs()
self.assertEqual(expected_streaming_specs, actual_streaming_specs)

def test_stream_http(self):

# If the http scheme is used in the plotly_streaming_domain, port 80
# should be used for streaming and ssl_enabled should be False

py.sign_in(un, ak,
**{'plotly_streaming_domain': 'http://stream.plot.ly'})
my_stream = py.Stream(tk)
expected_streaming_specs = {
'server': 'stream.plot.ly',
'port': 80,
'ssl_enabled': False,
'ssl_verification_enabled': False,
'headers': {
'Host': 'stream.plot.ly',
'plotly-streamtoken': tk
}
}
}
actual_streaming_specs = my_stream.get_streaming_specs()
self.assertEqual(expected_streaming_specs, actual_streaming_specs)

def test_stream_https(self):

# If the https scheme is used in the plotly_streaming_domain, port 443
# should be used for streaming, ssl_enabled should be True,
# and ssl_verification_enabled should equal plotly_ssl_verification

ssl_stream_config = {
'plotly_streaming_domain': 'https://stream.plot.ly',
'plotly_ssl_verification': True
}
py.sign_in(un, ak, **ssl_stream_config)
my_stream = py.Stream(tk)
expected_streaming_specs = {
'server': 'stream.plot.ly',
'port': 443,
'ssl_enabled': True,
'ssl_verification_enabled': True,
'headers': {
'Host': 'stream.plot.ly',
'plotly-streamtoken': tk
actual_streaming_specs = my_stream.get_streaming_specs()
self.assertEqual(expected_streaming_specs, actual_streaming_specs)

def test_stream_https(self):

# If the https scheme is used in the plotly_streaming_domain, port 443
# should be used for streaming, ssl_enabled should be True,
# and ssl_verification_enabled should equal plotly_ssl_verification

ssl_stream_config = {
'plotly_streaming_domain': 'https://stream.plot.ly',
'plotly_ssl_verification': True
}
py.sign_in(un, ak, **ssl_stream_config)
my_stream = py.Stream(tk)
expected_streaming_specs = {
'server': 'stream.plot.ly',
'port': 443,
'ssl_enabled': True,
'ssl_verification_enabled': True,
'headers': {
'Host': 'stream.plot.ly',
'plotly-streamtoken': tk
}
}
}
actual_streaming_specs = my_stream.get_streaming_specs()
self.assertEqual(expected_streaming_specs, actual_streaming_specs)
actual_streaming_specs = my_stream.get_streaming_specs()
self.assertEqual(expected_streaming_specs, actual_streaming_specs)