You can now clear the active user for ownership history. See #1790.

This commit is contained in:
Dion Moult
2021-10-12 19:12:15 +11:00
parent fc2e12bff6
commit f6128febe9
11 changed files with 54 additions and 8 deletions
@@ -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
+6
View File
@@ -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)
+10
View File
@@ -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):