mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 09:48:32 +00:00
update serializer settings literals #4912
This commit is contained in:
@@ -7,10 +7,11 @@ from typing import get_args
|
||||
|
||||
|
||||
class TestGeomSettings:
|
||||
def test_run(self):
|
||||
def test_settings(self):
|
||||
settings = ifcopenshell.geom.settings()
|
||||
assert set(get_args(ifcopenshell.geom.SETTING)) == set(settings.setting_names())
|
||||
|
||||
assert "use-python-opencascade" in settings.setting_names()
|
||||
assert settings.get(settings.USE_PYTHON_OPENCASCADE) is False
|
||||
assert settings.get("use-python-opencascade") is False
|
||||
assert "USE_PYTHON_OPENCASCADE = False" in repr(settings)
|
||||
@@ -27,6 +28,18 @@ class TestGeomSettings:
|
||||
settings.set(settings.USE_PYTHON_OPENCASCADE, True)
|
||||
assert "USE_PYTHON_OPENCASCADE = False" in repr(settings)
|
||||
|
||||
def test_serializer_settings(self):
|
||||
settings = ifcopenshell.geom.serializer_settings()
|
||||
assert set(get_args(ifcopenshell.geom.SERIALIZER_SETTING)) == set(settings.setting_names())
|
||||
|
||||
# Only for settings.
|
||||
assert "use-python-opencascade" not in settings.setting_names()
|
||||
with pytest.raises(AttributeError):
|
||||
settings.get(settings.USE_PYTHON_OPENCASCADE)
|
||||
with pytest.raises(RuntimeError):
|
||||
settings.get("use-python-opencascade")
|
||||
assert "USE_PYTHON_OPENCASCADE" not in repr(settings)
|
||||
|
||||
|
||||
class TestAssignObject:
|
||||
def test_no_welding_on_distinct_items(self):
|
||||
|
||||
Reference in New Issue
Block a user