Files
specklepy/tests/unit/test_instances.py
KatKatKateryna 71ca5318b6 fix tests
2024-12-06 03:59:03 +00:00

39 lines
932 B
Python

# pylint: disable=redefined-outer-name
import pytest
from specklepy.core.api.models.instances import InstanceDefinitionProxy, InstanceProxy
@pytest.fixture()
def instance_proxy():
return InstanceProxy(
definitionId="definitionId", transform=[1, 23.5], units="unit", maxDepth=3
)
@pytest.fixture()
def instance_definition_proxy():
return InstanceDefinitionProxy(
objects=["app_id_1", "app_id_2"], maxDepth=2, name="group_proxy_name"
)
def test_create_instance_proxy():
try:
InstanceProxy(definitionId="", transform="", units="", maxDepth=1) # wrong type
assert False
except TypeError:
assert True
except:
assert False
def test_create_instance_definition_proxy():
try:
InstanceDefinitionProxy(objects="", maxDepth=1, name="") # wrong type
assert False
except TypeError:
assert True
except:
assert False