Add georeferencing integration tests

This commit is contained in:
Dion Moult
2024-06-30 17:01:39 +10:00
parent 2efeb6edb3
commit 4e9f2ea4b2
3 changed files with 367 additions and 10 deletions
+11
View File
@@ -20,6 +20,7 @@ import os
import bpy
import traceback
import webbrowser
import numpy as np
import ifcopenshell
import blenderbim.tool as tool
import blenderbim.bim
@@ -671,6 +672,16 @@ def prop_is_roughly_value(prop, value):
assert False, f"Value is {actual_value}"
@then(parsers.parse('the object "{name}" has a cartesian point offset of "{offset}"'))
def the_object_name_has_a_cartesian_point_offset_of_offset(name, offset):
offset = replace_variables(offset)
obj = the_object_name_exists(name)
assert obj.BIMObjectProperties.blender_offset_type == "CARTESIAN_POINT"
obj_offset = np.array(tuple(map(float, obj.BIMObjectProperties.cartesian_point_offset.split(","))))
offset = np.array(tuple(map(float, offset.split(","))))
assert np.allclose(obj_offset, offset)
@then(parsers.parse('the object "{name}" has the material "{material}"'))
def the_object_name_has_the_material_material(name, material):
assert material in [ms.material.name for ms in the_object_name_exists(name).material_slots]