mod: ядро (14) циферки в виде фигур

This commit is contained in:
2026-09-06 00:55:22 +03:00
parent 217056b37b
commit 5904fc675d
4 changed files with 53 additions and 19 deletions
+8 -1
View File
@@ -78,7 +78,7 @@ class HalftoneServiceTests(BaseMediaTestCase):
self.assertIn("<desc>Generated by Hypn0", svg)
def test_generate_shapes(self):
shapes = ["circle", "ring", "square", "diamond", "triangle", "hexagon", "star", "cross", "line", "snowflake", "heart"]
shapes = ["circle", "ring", "square", "diamond", "triangle", "hexagon", "star", "cross", "line", "snowflake", "binary", "heart"]
for shape in shapes:
svg = generate_halftone_svg(self.img, cols=20, max_radius=5, shape=shape)
self.assertIn("<svg", svg)
@@ -100,6 +100,13 @@ class HalftoneServiceTests(BaseMediaTestCase):
self.assertIn('<polygon id="s', snowflake_svg)
self.assertIn('points="', snowflake_svg)
# Проверяем структуру матрицы 0/1: текстовый моноширинный элемент и наличие обоих символов 0 и 1
binary_svg = generate_halftone_svg(self.img, cols=20, max_radius=8, shape="binary")
self.assertIn('<text id="s', binary_svg)
self.assertIn('font-family="ui-monospace,monospace"', binary_svg)
self.assertIn(">0</text>", binary_svg)
self.assertIn(">1</text>", binary_svg)
def test_generate_static_blink_zero(self):
svg = generate_halftone_svg(self.img, cols=20, blink=0)
self.assertIn("animation:none", svg)