Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
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
1 change: 1 addition & 0 deletions doc/changelog.d/229.test.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test: Add tests for dark mode
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "flit_core.buildapi"

[project]
name = "ansys-tools-visualization-interface"
version = "0.5.dev0"
version = "0.7.dev0"
description = "A Python visualization interface for PyAnsys libraries"
readme = "README.rst"
requires-python = ">=3.10,<4"
Expand Down
30 changes: 30 additions & 0 deletions tests/test_generic_plotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,3 +148,33 @@ def test_screenshot(tmp_path):
pl.plot(sphere)
pl.show(screenshot=tmp_path / "screenshot.png")
assert Path(tmp_path / "screenshot.png").is_file()


def test_dark_mode():
"""Test dark mode different functionalities."""
# Test auto dark mode
sphere = pv.Sphere()
pl = Plotter()
pl.backend.scene.background_color = [10, 10, 10]
pl.plot(sphere)
pl.show()

# Test auto dark mode below threshold
sphere = pv.Sphere()
pl = Plotter()
pl.backend.scene.background_color = [10, 10, 10]
pl.plot(sphere)
pl.show()

# Test auto dark mode above threshold
sphere = pv.Sphere()
pl = Plotter()
pl.backend.scene.background_color = [0, 121, 255]
pl.plot(sphere)
pl.show()

# Test manual dark mode
sphere = pv.Sphere()
pl = Plotter()
pl.plot(sphere)
pl.show(dark_mode=True)
Loading