mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-28 15:53:00 +00:00
You can now clear the active user for ownership history. See #1790.
This commit is contained in:
@@ -233,3 +233,8 @@ Scenario: Set user
|
||||
And the variable "user" is "{ifc}.by_type('IfcPersonAndOrganization')[0].id()"
|
||||
And I press "bim.set_user(user={user})"
|
||||
Then nothing happens
|
||||
|
||||
Scenario: Clear user
|
||||
Given an empty IFC project
|
||||
When I press "bim.clear_user(user={user})"
|
||||
Then nothing happens
|
||||
|
||||
@@ -219,3 +219,9 @@ class TestGetUser:
|
||||
def test_run(self, owner):
|
||||
owner.get_user().should_be_called().will_return("person_and_organisation")
|
||||
assert subject.get_user(owner) == "person_and_organisation"
|
||||
|
||||
|
||||
class TestClearUser:
|
||||
def test_run(self, owner):
|
||||
owner.clear_user().should_be_called()
|
||||
subject.clear_user(owner)
|
||||
|
||||
@@ -45,6 +45,16 @@ class TestGetUser(test.bim.bootstrap.NewFile):
|
||||
user = tool.Ifc.get().by_type("IfcPersonAndOrganization")[0]
|
||||
assert subject.get_user() == user
|
||||
|
||||
def test_falling_back_to_any_available_user_ifc2x3(self):
|
||||
assert subject.get_user() is None
|
||||
ifc = ifcopenshell.file(schema="IFC2X3")
|
||||
tool.Ifc.set(ifc)
|
||||
user = ifc.createIfcPersonAndOrganization()
|
||||
assert subject.get_user() == user
|
||||
user2 = ifc.createIfcPersonAndOrganization()
|
||||
subject.set_user(user2)
|
||||
assert subject.get_user() == user2
|
||||
|
||||
|
||||
class TestClearUser(test.bim.bootstrap.NewFile):
|
||||
def test_run(self):
|
||||
|
||||
Reference in New Issue
Block a user