mirror of
https://github.com/ManimCommunity/manim.git
synced 2026-06-22 10:01:47 +00:00
* Format imports using Isort. Add a check for pull requests. Signed-off-by: Naveen M K <naveen@syrusdark.website> * CI: update check's name
41 lines
763 B
Python
41 lines
763 B
Python
import types
|
|
|
|
import pytest
|
|
|
|
from manim.mobject.mobject import Mobject
|
|
|
|
|
|
def test_generic_set():
|
|
m = Mobject()
|
|
m.set(test=0)
|
|
|
|
assert m.test == 0
|
|
|
|
|
|
@pytest.mark.filterwarnings("ignore::DeprecationWarning")
|
|
def test_get_compat_layer():
|
|
m = Mobject()
|
|
|
|
assert isinstance(m.get_test, types.MethodType)
|
|
with pytest.raises(AttributeError):
|
|
m.get_test()
|
|
|
|
m.test = 0
|
|
assert m.get_test() == 0
|
|
|
|
|
|
@pytest.mark.filterwarnings("ignore::DeprecationWarning")
|
|
def test_set_compat_layer():
|
|
m = Mobject()
|
|
|
|
assert isinstance(m.set_test, types.MethodType)
|
|
m.set_test(0)
|
|
|
|
assert m.test == 0
|
|
|
|
|
|
def test_nonexistent_attr():
|
|
m = Mobject()
|
|
|
|
with pytest.raises(AttributeError, match="object has no attribute"):
|
|
m.test
|