From 2c8581bd41fe8d13046848a4d26d59a6d4c84592 Mon Sep 17 00:00:00 2001 From: Cal Date: Sat, 17 Jan 2026 12:22:54 -0700 Subject: [PATCH] add unit test --- evennia/commands/default/tests.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/evennia/commands/default/tests.py b/evennia/commands/default/tests.py index 5db4c14acd..2a25251265 100644 --- a/evennia/commands/default/tests.py +++ b/evennia/commands/default/tests.py @@ -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