test_brick: fix warnings from sqlalchemy

When fixing warnings, noticed that was working a bit inproperly - `bnode` always end up being an empty list (because there's no `brick, A, REF.IFCReference` triple), so then passing empty list to `triples` resulted in selecting all nodes isntead of just the expected `bnode` (that's the behaviour `sqlachemy` was sending the warnings about - when empty lists unexpectedly selected everything).
This commit is contained in:
Andrej730
2026-09-02 17:59:56 +05:00
parent 4eb093eefa
commit c23972d440
+4 -4
View File
@@ -148,10 +148,10 @@ class TestAddBrickifcReference(NewFile):
project = URIRef(f"http://example.org/digitaltwin#{tool.Ifc.get().by_type('IfcProject')[0].GlobalId}")
subject.add_brickifc_reference("http://example.org/digitaltwin#foo", element, project)
brick = URIRef("http://example.org/digitaltwin#foo")
bnode = list(BrickStore.graph.triples((brick, A, REF.IFCReference)))
assert list(BrickStore.graph.triples((bnode, REF.hasIfcProjectReference, URIRef(project))))
assert list(BrickStore.graph.triples((bnode, REF.ifcGlobalID, Literal(element.GlobalId))))
assert list(BrickStore.graph.triples((bnode, REF.ifcName, Literal(element.Name))))
bnode = next(BrickStore.graph.triples((brick, REF.hasExternalReference, None)))[2]
assert len(list(BrickStore.graph.triples((bnode, REF.hasIfcProjectReference, URIRef(project))))) == 1
assert len(list(BrickStore.graph.triples((bnode, REF.ifcGlobalID, Literal(element.GlobalId))))) == 1
assert len(list(BrickStore.graph.triples((bnode, REF.ifcName, Literal(element.Name))))) == 1
class TestAddRelation(NewFile):