mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 01:41:57 +00:00
Use indices instead of WorkTimeDatesInterface
Checking start/end dates are done very, very often in date calculations (often looping through every day in a date range). So I'd prefer more opaque code but less overhead.
This commit is contained in:
@@ -19,7 +19,6 @@
|
||||
import datetime
|
||||
import test.bootstrap
|
||||
import ifcopenshell.api
|
||||
from ifcopenshell.util.data import WorkTimeDatesInterface
|
||||
|
||||
|
||||
class TestEditWorkTime(test.bootstrap.IFC4):
|
||||
@@ -35,13 +34,12 @@ class TestEditWorkTime(test.bootstrap.IFC4):
|
||||
"Finish": datetime.datetime(2020, 2, 1),
|
||||
}
|
||||
ifcopenshell.api.run("sequence.edit_work_time", self.file, work_time=work_time, attributes=attributes)
|
||||
worktime_dates = WorkTimeDatesInterface(work_time)
|
||||
assert work_time.Name == attributes["Name"]
|
||||
assert work_time.DataOrigin == attributes["DataOrigin"]
|
||||
assert work_time.UserDefinedDataOrigin == attributes["UserDefinedDataOrigin"]
|
||||
assert work_time.RecurrencePattern == attributes["RecurrencePattern"]
|
||||
assert worktime_dates.Start == "2020-01-01"
|
||||
assert worktime_dates.Finish == "2020-02-01"
|
||||
assert work_time.Start == "2020-01-01"
|
||||
assert work_time.Finish == "2020-02-01"
|
||||
|
||||
|
||||
class TestEditWorkTimeIFC4X3(test.bootstrap.IFC4X3):
|
||||
|
||||
Reference in New Issue
Block a user