mirror of
https://github.com/ManimCommunity/manim.git
synced 2026-06-22 10:01:47 +00:00
Co-authored-by: Francisco Manríquez Novoa <49853152+chopan050@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
27 lines
607 B
Python
27 lines
607 B
Python
from __future__ import annotations
|
|
|
|
from manim import Circle, ReplacementTransform, Scene, Square, VGroup
|
|
|
|
|
|
def test_no_duplicate_references():
|
|
scene = Scene()
|
|
c = Circle()
|
|
sq = Square()
|
|
scene.add(c, sq)
|
|
|
|
scene.play(ReplacementTransform(c, sq))
|
|
assert len(scene.mobjects) == 1
|
|
assert scene.mobjects[0] is sq
|
|
|
|
|
|
def test_duplicate_references_in_group():
|
|
scene = Scene()
|
|
c = Circle()
|
|
sq = Square()
|
|
vg = VGroup(c, sq)
|
|
scene.add(vg)
|
|
|
|
scene.play(ReplacementTransform(c, sq))
|
|
submobs = vg.submobjects
|
|
assert len(submobs) == 1
|
|
assert submobs[0] is sq
|