add unit test

This commit is contained in:
Cal 2026-01-17 12:22:54 -07:00
parent 3ebc9316f9
commit 2c8581bd41

View file

@ -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