Files
specklepy/tests/test_base.py
T
2021-02-05 11:23:25 +00:00

24 lines
579 B
Python

import pytest
from speckle.objects.base import Base
class TestBase:
def test_empty_prop_names(self):
base = Base()
with pytest.raises(ValueError):
base[""] = "empty"
with pytest.raises(ValueError):
base["@"] = "empty"
def test_invalid_prop_names(self):
base = Base()
with pytest.raises(ValueError):
base["@@wow"] = "bad"
with pytest.raises(ValueError):
base["this.is.bad"] = "also bad"
with pytest.raises(ValueError):
base["super/bad"] = "no no no"