Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
scottshambaugh committed Dec 15, 2023
1 parent 46a6976 commit 4cf58bd
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 3 deletions.
1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
31 changes: 29 additions & 2 deletions tests/test_AxesStereo.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,36 @@ 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:
getattr(axstereo, method)(x, y, z)
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()
Expand All @@ -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
Expand Down

0 comments on commit 4cf58bd

Please sign in to comment.