mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-11 10:06:47 +00:00
Run black on IfcOpenShell-python.
This commit is contained in:
@@ -5,13 +5,18 @@ import ifcopenshell.api
|
||||
class TestEditLibrary(test.bootstrap.IFC4):
|
||||
def test_editing_a_library(self):
|
||||
library = self.file.createIfcLibraryInformation()
|
||||
ifcopenshell.api.run("library.edit_library", self.file, library=library, attributes={
|
||||
"Name": "Name",
|
||||
"Version": "Version",
|
||||
"VersionDate": "VersionDate",
|
||||
"Location": "Location",
|
||||
"Description": "Description",
|
||||
})
|
||||
ifcopenshell.api.run(
|
||||
"library.edit_library",
|
||||
self.file,
|
||||
library=library,
|
||||
attributes={
|
||||
"Name": "Name",
|
||||
"Version": "Version",
|
||||
"VersionDate": "VersionDate",
|
||||
"Location": "Location",
|
||||
"Description": "Description",
|
||||
},
|
||||
)
|
||||
assert library.Name == "Name"
|
||||
assert library.Version == "Version"
|
||||
assert library.VersionDate == "VersionDate"
|
||||
|
||||
@@ -5,13 +5,18 @@ import ifcopenshell.api
|
||||
class TestEditReference(test.bootstrap.IFC4):
|
||||
def test_editing_a_reference(self):
|
||||
reference = self.file.createIfcLibraryReference()
|
||||
ifcopenshell.api.run("library.edit_reference", self.file, reference=reference, attributes={
|
||||
"Location": "Location",
|
||||
"Identification": "Identification",
|
||||
"Name": "Name",
|
||||
"Description": "Description",
|
||||
"Language": "Language",
|
||||
})
|
||||
ifcopenshell.api.run(
|
||||
"library.edit_reference",
|
||||
self.file,
|
||||
reference=reference,
|
||||
attributes={
|
||||
"Location": "Location",
|
||||
"Identification": "Identification",
|
||||
"Name": "Name",
|
||||
"Description": "Description",
|
||||
"Language": "Language",
|
||||
},
|
||||
)
|
||||
assert reference.Location == "Location"
|
||||
assert reference.Identification == "Identification"
|
||||
assert reference.Name == "Name"
|
||||
|
||||
@@ -12,8 +12,8 @@ class TestRemoveLibrary(test.bootstrap.IFC4):
|
||||
library = self.file.createIfcLibraryInformation()
|
||||
reference1 = self.file.createIfcLibraryReference(ReferencedLibrary=library)
|
||||
reference2 = self.file.createIfcLibraryReference(ReferencedLibrary=library)
|
||||
self.file.createIfcRelAssociatesLibrary(GlobalId='foo', RelatingLibrary=library)
|
||||
self.file.createIfcRelAssociatesLibrary(GlobalId='bar', RelatingLibrary=reference1)
|
||||
self.file.createIfcRelAssociatesLibrary(GlobalId="foo", RelatingLibrary=library)
|
||||
self.file.createIfcRelAssociatesLibrary(GlobalId="bar", RelatingLibrary=reference1)
|
||||
ifcopenshell.api.run("library.remove_library", self.file, library=library)
|
||||
assert len(self.file.by_type("IfcLibraryReference")) == 0
|
||||
assert len(self.file.by_type("IfcRelAssociatesLibrary")) == 0
|
||||
|
||||
Reference in New Issue
Block a user