mirror of
https://github.com/ManimCommunity/manim.git
synced 2026-06-22 10:01:47 +00:00
* start test reorganization * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * move boolean ops * move more tests * Move more tests * more reorganization * more movements * mostly finish up reorganization * Finish reorganization tests in parent dir * try moving interface tests back * Move test_commands over * fix relative path to templates Co-authored-by: Darylgolden <darylgolden@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
23 lines
717 B
Python
23 lines
717 B
Python
from __future__ import annotations
|
|
|
|
from colour import Color
|
|
|
|
from manim.mobject.text.text_mobject import MarkupText, Text
|
|
|
|
|
|
def test_font_size():
|
|
"""Test that Text and MarkupText return the
|
|
correct font_size value after being scaled."""
|
|
text_string = Text("0").scale(0.3)
|
|
markuptext_string = MarkupText("0").scale(0.3)
|
|
|
|
assert round(text_string.font_size, 5) == 14.4
|
|
assert round(markuptext_string.font_size, 5) == 14.4
|
|
|
|
|
|
def test_non_str_color():
|
|
"""Test that the Text and MarkupText can accept non_str color values
|
|
i.e. colour.Color(red)."""
|
|
|
|
text = Text("test_color_inheritance", color=Color("blue"))
|
|
markup_text = MarkupText("test_color_inheritance", color=Color("blue"))
|