Skip to content

Commit 09a12d8

Browse files
author
Hugues Devimeux
committed
added assertiions for graphical_units
1 parent 2687e74 commit 09a12d8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tests/helpers/graphical_units.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import tempfile
66
import numpy as np
77

8-
import manim
98
from manim import config, file_writer_config, logger
109

1110

@@ -43,11 +42,14 @@ def set_test_scene(scene_object, module_name):
4342
scene.render()
4443
data = scene.renderer.get_frame()
4544

45+
assert not np.all(
46+
data == np.array([0, 0, 0, 255])
47+
), f"Control data generated for {str(scene)} only contains empty pixels."
48+
assert data.shape == (480, 854, 4)
4649
tests_directory = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
4750
path_control_data = os.path.join(
4851
tests_directory, "control_data", "graphical_units_data"
4952
)
50-
print(path_control_data)
5153
path = os.path.join(path_control_data, module_name)
5254
if not os.path.isdir(path):
5355
os.makedirs(path)

0 commit comments

Comments
 (0)