ifc2x3 tests

removed part of test_append_two_type_products_sharing_the_same_material_indirectly_via_a_material_set for ifc2x3 compatibility and removed part is already tested in test_append_two_type_products_sharing_the_same_material_with_properties
This commit is contained in:
Andrej730
2024-05-13 12:32:58 +05:00
parent 3665dda87c
commit a9cba30da6
35 changed files with 395 additions and 262 deletions
@@ -17,26 +17,41 @@
# along with IfcOpenShell. If not, see <http://www.gnu.org/licenses/>.
import test.bootstrap
import datetime
import ifcopenshell.api
import ifcopenshell.util.date
class TestEditLibrary(test.bootstrap.IFC4):
def test_editing_a_library(self):
library = self.file.createIfcLibraryInformation()
dt = datetime.datetime.now()
attributes = {
"Name": "Name",
"Version": "Version",
"VersionDate": dt,
}
if self.file.schema != "IFC2X3":
attributes["Location"] = "Location"
attributes["Description"] = "Description"
ifcopenshell.api.run(
"library.edit_library",
self.file,
library=library,
attributes={
"Name": "Name",
"Version": "Version",
"VersionDate": "VersionDate",
"Location": "Location",
"Description": "Description",
},
attributes=attributes,
)
assert library.Name == "Name"
assert library.Version == "Version"
assert library.VersionDate == "VersionDate"
assert library.Location == "Location"
assert library.Description == "Description"
if self.file.schema != "IFC2X3":
assert library.VersionDate == ifcopenshell.util.date.datetime2ifc(dt, "IfcDateTime")
assert library.Location == "Location"
assert library.Description == "Description"
else:
info = library.VersionDate.get_info()
del info["id"], info["type"]
assert info == ifcopenshell.util.date.datetime2ifc(dt, "IfcCalendarDate")
class TestEditLibraryIFC2X3(test.bootstrap.IFC2X3, TestEditLibrary):
pass