Skip to content

Commit 7243604

Browse files
test: Add tests for dark mode
1 parent d8d9330 commit 7243604

File tree

2 files changed

+31
-1
lines changed

2 files changed

+31
-1
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "flit_core.buildapi"
44

55
[project]
66
name = "ansys-tools-visualization-interface"
7-
version = "0.5.dev0"
7+
version = "0.7.dev0"
88
description = "A Python visualization interface for PyAnsys libraries"
99
readme = "README.rst"
1010
requires-python = ">=3.10,<4"

tests/test_generic_plotter.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,3 +148,33 @@ def test_screenshot(tmp_path):
148148
pl.plot(sphere)
149149
pl.show(screenshot=tmp_path / "screenshot.png")
150150
assert Path(tmp_path / "screenshot.png").is_file()
151+
152+
153+
def test_dark_mode():
154+
"""Test dark mode different functionalities."""
155+
# Test auto dark mode
156+
sphere = pv.Sphere()
157+
pl = Plotter()
158+
pl.backend.scene.background_color = [10, 10, 10]
159+
pl.plot(sphere)
160+
pl.show()
161+
162+
# Test auto dark mode below threshold
163+
sphere = pv.Sphere()
164+
pl = Plotter()
165+
pl.backend.scene.background_color = [10, 10, 10]
166+
pl.plot(sphere)
167+
pl.show()
168+
169+
# Test auto dark mode above threshold
170+
sphere = pv.Sphere()
171+
pl = Plotter()
172+
pl.backend.scene.background_color = [0, 121, 255]
173+
pl.plot(sphere)
174+
pl.show()
175+
176+
# Test manual dark mode
177+
sphere = pv.Sphere()
178+
pl = Plotter()
179+
pl.plot(sphere)
180+
pl.show(dark_mode=True)

0 commit comments

Comments
 (0)