mirror of
https://github.com/evennia/evennia.git
synced 2026-03-16 21:06:30 +01:00
add unit test
This commit is contained in:
parent
3ebc9316f9
commit
2c8581bd41
1 changed files with 19 additions and 0 deletions
|
|
@ -1920,6 +1920,25 @@ class TestBuilding(BaseEvenniaCommandTest):
|
|||
building.CmdSpawn(), "/examine NO_EXISTS", "No prototype named 'NO_EXISTS' was found."
|
||||
)
|
||||
|
||||
def test_setattr_view_with_category(self):
|
||||
"""
|
||||
Test checking attributes with a category, including nested attributes.
|
||||
"""
|
||||
self.obj1.attributes.add("test", "value", category="cat")
|
||||
self.call(
|
||||
building.CmdSetAttribute(),
|
||||
"Obj/test:cat",
|
||||
"Attribute Obj/test [category:cat] = value",
|
||||
)
|
||||
|
||||
# nested dict
|
||||
self.obj1.attributes.add("testdict", {"key": "value"}, category="cat")
|
||||
self.call(
|
||||
building.CmdSetAttribute(),
|
||||
"Obj/testdict['key']:cat",
|
||||
"Attribute Obj/testdict['key'] [category:cat] = value",
|
||||
)
|
||||
|
||||
|
||||
import evennia.commands.default.comms as cmd_comms # noqa
|
||||
from evennia.comms.comms import DefaultChannel # noqa
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue