From 4cf58bdbdcefa8ed6c7350c717a88ff17a42ee4d Mon Sep 17 00:00:00 2001 From: Scott Shambaugh Date: Fri, 15 Dec 2023 05:19:36 -0700 Subject: [PATCH] tests --- CHANGELOG.md | 1 - tests/test_AxesStereo.py | 31 +++++++++++++++++++++++++++++-- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 13b27ff..1b59f2f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,6 @@ - Red/cyan anaglyphs - 3D take into account roll angle - 3D shareview override -- 3D test ortho view - Document derivation of offsets - Animated stereogram example - GH release publish to pypi diff --git a/tests/test_AxesStereo.py b/tests/test_AxesStereo.py index 6521f66..5c3c93f 100644 --- a/tests/test_AxesStereo.py +++ b/tests/test_AxesStereo.py @@ -21,8 +21,17 @@ def _testdata(): return data +def test_existing_fig(): + # Smoke tests + fig = plt.figure() + _ = AxesStereo2D(fig=fig) + fig = plt.figure() + _ = AxesStereo3D(fig=fig) + assert True + + def test_AxesStereo2D(): - # Smoke test + # Smoke test plotting x, y, z = _testdata()['trefoil'] axstereo = AxesStereo2D() for method in axstereo.known_methods: @@ -30,9 +39,18 @@ def test_AxesStereo2D(): getattr(axstereo, method)(x=x, y=y, z=z) assert True + # Smoke test focal plane + axstereo = AxesStereo2D(focal_plane=1.0) + axstereo.plot(x, y, z) + assert True + + # Smoke test non-plotting methods + axstereo.set_title('title') + assert True + def test_AxesStereo3D(): - # Smoke test + # Smoke test plotting x, y, z = _testdata()['trefoil'] X, Y, Z = _testdata()['3d_default'] axstereo = AxesStereo3D() @@ -49,6 +67,15 @@ def test_AxesStereo3D(): getattr(axstereo, method)(X=X, Y=Y, Z=Z) assert True + # Smoke test focal plane + axstereo = AxesStereo3D(focal_plane=1.0) + axstereo.plot(x, y, z) + assert True + + # Smoke test non-plotting methods + axstereo.set_title('title') + assert True + def plotting_tests_2d_pairwise(): # test plot and scatter