MCPcopy
hub / github.com/ManimCommunity/manim / test_code_initialization_from_string

Function test_code_initialization_from_string

tests/test_code_mobject.py:8–23  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

6
7
8def test_code_initialization_from_string():
9 code_string = """from manim import Scene, Square
10
11class FadeInSquare(Scene):
12 def construct(self):
13 s = Square()
14 self.play(FadeIn(s))
15 self.play(s.animate.scale(2))
16 self.wait()"""
17 rendered_code = Code(
18 code_string=code_string,
19 language="python",
20 )
21 num_lines = len(code_string.split("\n"))
22 assert len(rendered_code.code_lines) == num_lines
23 assert len(rendered_code.line_numbers) == num_lines
24
25
26def test_code_initialization_from_file():

Callers

nothing calls this directly

Calls 2

CodeClass · 0.90
splitMethod · 0.45

Tested by

no test coverage detected