import ifcopenshell import test.bootstrap import ifcopenshell.util.placement as subject class TestGetStoreyElevationIFC4(test.bootstrap.IFC4): def test_run(self): storey = self.file.createIfcBuildingStorey() placement = self.file.createIfcLocalPlacement() placement.RelativePlacement = self.file.createIfcAxis2Placement3D( self.file.createIfcCartesianPoint((0.0, 0.0, 3.0)) ) storey.ObjectPlacement = placement assert subject.get_storey_elevation(storey) == 3.0 def test_getting_the_elevation_if_no_z_location(self): storey = self.file.createIfcBuildingStorey() storey.Elevation = 3.0 assert subject.get_storey_elevation(storey) == 3.0 def test_returning_0_as_a_fallback(self): storey = self.file.createIfcBuildingStorey() assert subject.get_storey_elevation(storey) == 0.0 building = self.file.createIfcBuilding() assert subject.get_storey_elevation(building) == 0.0