mirror of
https://github.com/evennia/evennia.git
synced 2026-03-16 21:06:30 +01:00
Added tests for new lock features.
This commit is contained in:
parent
7685ce9623
commit
b3f4962f7e
1 changed files with 25 additions and 0 deletions
|
|
@ -114,6 +114,31 @@ class DefaultObjectTest(BaseEvenniaTest):
|
|||
# partial match to 'colon' - multimatch error since stack is not homogenous
|
||||
self.assertEqual(self.char1.search("co", stacked=2), None)
|
||||
|
||||
def test_get_default_lockstring_base(self):
|
||||
pattern = f"control:pid({self.account.id}) or id({self.char1.id}) or perm(Admin);delete:pid({self.account.id}) or id({self.char1.id}) or perm(Admin);edit:pid({self.account.id}) or id({self.char1.id}) or perm(Admin)"
|
||||
self.assertEqual(
|
||||
DefaultObject.get_default_lockstring(account=self.account, caller=self.char1), pattern
|
||||
)
|
||||
|
||||
def test_get_default_lockstring_room(self):
|
||||
pattern = f"control:pid({self.account.id}) or id({self.char1.id}) or perm(Admin);delete:pid({self.account.id}) or id({self.char1.id}) or perm(Admin);edit:pid({self.account.id}) or id({self.char1.id}) or perm(Admin)"
|
||||
self.assertEqual(
|
||||
DefaultRoom.get_default_lockstring(account=self.account, caller=self.char1), pattern
|
||||
)
|
||||
|
||||
def test_get_default_lockstring_exit(self):
|
||||
pattern = f"control:pid({self.account.id}) or id({self.char1.id}) or perm(Admin);delete:pid({self.account.id}) or id({self.char1.id}) or perm(Admin);edit:pid({self.account.id}) or id({self.char1.id}) or perm(Admin)"
|
||||
self.assertEqual(
|
||||
DefaultExit.get_default_lockstring(account=self.account, caller=self.char1), pattern
|
||||
)
|
||||
|
||||
def test_get_default_lockstring_character(self):
|
||||
pattern = f"puppet:pid({self.account.id}) or perm(Developer) or pperm(Developer);delete:pid({self.account.id}) or perm(Admin);edit:pid({self.account.id}) or perm(Admin)"
|
||||
self.assertEqual(
|
||||
DefaultCharacter.get_default_lockstring(account=self.account, caller=self.char1),
|
||||
pattern,
|
||||
)
|
||||
|
||||
|
||||
class TestObjectManager(BaseEvenniaTest):
|
||||
"Test object manager methods"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue