MCPcopy Create free account
hub / github.com/IfcOpenShell/IfcOpenShell / test_massive_bcf

Function test_massive_bcf

src/bcf/tests/v3/test_bcf_xml.py:99–114  ·  view source on GitHub ↗
(xml_handler)

Source from the content-addressed store, hash-verified

97
98
99def test_massive_bcf(xml_handler) -> None:
100 ext = mdl.Extensions(topic_types=mdl.ExtensionsTopicTypes(topic_type=["Test type"]))
101 bcf = BcfXml.create_new("Test project", extensions=ext, xml_handler=xml_handler)
102 for i in range(100):
103 th = bcf.add_topic(f"Topic {i:04}", f"Message {i:04}", "Test author", "Test type")
104 vi = mdl.VisualizationInfo(
105 guid=str(uuid.uuid4()),
106 components=build_components(str(uuid.uuid4())),
107 perspective_camera=build_camera_from_vectors([i, 0, 0], [0, 1, 0], [0, 0, 1]),
108 )
109 vh = VisualizationInfoHandler(visualization_info=vi, xml_handler=xml_handler)
110 th.add_visinfo_handler(vh)
111 assert len(bcf.topics) == 100
112 with TemporaryDirectory() as tmp_dir:
113 file_path = Path(tmp_dir) / "test.bcf"
114 bcf.save(file_path)
115
116
117def test_equality_with_wrong_object(build_sample) -> None:

Callers

nothing calls this directly

Calls 8

build_componentsFunction · 0.90
rangeFunction · 0.50
create_newMethod · 0.45
add_topicMethod · 0.45
add_visinfo_handlerMethod · 0.45
saveMethod · 0.45

Tested by

no test coverage detected