def test_setting_units(): b = Base(units="foot") assert b.units == "ft" with pytest.raises(SpeckleException): b.units = "big" b.units = None # invalid args are skipped b.units = 7 assert b.units == "ft"
def base(): base = Base() base.name = "my_base" base.units = "millimetres" base.vertices = [random.uniform(0, 10) for _ in range(1, 120)] base.test_bases = [Base(name=i) for i in range(1, 22)] base["@detach"] = Base(name="detached base") return base
def base(): base = Base() base.name = "my_base" base.units = "millimetres" base.vertices = [random.uniform(0, 10) for _ in range(1, 120)] base.test_bases = [Base(name=i) for i in range(1, 22)] base["@detach"] = Base(name="detached base") base["@revit_thing"] = Base.of_type("SpecialRevitFamily", name="secret tho") return base