-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add basic smoketests for Jupyter VisPy exporters.
- Loading branch information
Showing
4 changed files
with
55 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
glue_plotly/html_exporters/jupyter/tests/test_scatter3d.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import os | ||
|
||
from glue.core import Data | ||
from glue_plotly.html_exporters.jupyter.tests.test_base import TestBqplotExporter | ||
|
||
from pytest import importorskip | ||
|
||
importorskip('glue_jupyter') | ||
importorskip('glue_vispy_viewers') | ||
|
||
from glue_vispy_viewers.scatter.jupyter import JupyterVispyScatterViewer # noqa: E402 | ||
|
||
|
||
class TestScatter3D(TestBqplotExporter): | ||
|
||
viewer_type = JupyterVispyScatterViewer | ||
tool_id = 'save:jupyter_plotly3dscatter' | ||
|
||
def make_data(self): | ||
return Data(x=[1, 2, 3], y=[4, 5, 6], z=[7, 8, 9], label='d1') | ||
|
||
def test_default(self, tmpdir): | ||
output_path = self.export_figure(tmpdir, 'test_default.html') | ||
assert os.path.exists(output_path) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import os | ||
|
||
from glue.core import Data | ||
from glue_plotly.html_exporters.jupyter.tests.test_base import TestBqplotExporter | ||
|
||
from pytest import importorskip | ||
|
||
importorskip('glue_jupyter') | ||
importorskip('glue_vispy_viewers') | ||
|
||
from glue_vispy_viewers.volume.jupyter import JupyterVispyVolumeViewer # noqa: E402 | ||
|
||
from numpy import arange, ones # noqa: E402 | ||
|
||
|
||
class TestVolume(TestBqplotExporter): | ||
|
||
viewer_type = JupyterVispyVolumeViewer | ||
tool_id = 'save:jupyter_plotlyvolume' | ||
|
||
def make_data(self): | ||
return Data(label='d1', | ||
x=arange(24).reshape((2, 3, 4)), | ||
y=ones((2, 3, 4)), | ||
z=arange(100, 124).reshape((2, 3, 4))) | ||
|
||
def test_default(self, tmpdir): | ||
output_path = self.export_figure(tmpdir, 'test_default.html') | ||
assert os.path.exists(output_path) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters