From 5b9a43617f340f800c12eccc9e029cdb792579dd Mon Sep 17 00:00:00 2001 From: Jared Miller Date: Wed, 11 Feb 2026 20:41:13 -0500 Subject: [PATCH] Add open and close commands for containers --- src/mudlib/server.py | 2 ++ tests/test_open_close.py | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/mudlib/server.py b/src/mudlib/server.py index 2e1483b..106c9c0 100644 --- a/src/mudlib/server.py +++ b/src/mudlib/server.py @@ -13,12 +13,14 @@ from telnetlib3.server_shell import readline2 import mudlib.combat.commands import mudlib.commands +import mudlib.commands.containers import mudlib.commands.edit import mudlib.commands.fly import mudlib.commands.help import mudlib.commands.look import mudlib.commands.movement import mudlib.commands.play +import mudlib.commands.portals import mudlib.commands.quit import mudlib.commands.reload import mudlib.commands.spawn diff --git a/tests/test_open_close.py b/tests/test_open_close.py index 8fc3457..1cd7134 100644 --- a/tests/test_open_close.py +++ b/tests/test_open_close.py @@ -91,7 +91,7 @@ async def test_open_already_open(player, test_zone, mock_writer): """open on already-open container gives feedback.""" from mudlib.commands.containers import cmd_open - chest = Container(name="chest", location=test_zone, x=5, y=5, closed=False) + _chest = Container(name="chest", location=test_zone, x=5, y=5, closed=False) await cmd_open(player, "chest") output = mock_writer.write.call_args_list[-1][0][0] assert "already open" in output.lower() @@ -144,7 +144,7 @@ async def test_open_non_container(player, test_zone, mock_writer): """open on non-container thing gives feedback.""" from mudlib.commands.containers import cmd_open - rock = Thing(name="rock", location=test_zone, x=5, y=5) + _rock = Thing(name="rock", location=test_zone, x=5, y=5) await cmd_open(player, "rock") output = mock_writer.write.call_args_list[-1][0][0] assert "can't open" in output.lower() @@ -182,7 +182,7 @@ async def test_close_already_closed(player, test_zone, mock_writer): """close on already-closed container gives feedback.""" from mudlib.commands.containers import cmd_close - chest = Container(name="chest", location=test_zone, x=5, y=5, closed=True) + _chest = Container(name="chest", location=test_zone, x=5, y=5, closed=True) await cmd_close(player, "chest") output = mock_writer.write.call_args_list[-1][0][0] assert "already closed" in output.lower() @@ -203,7 +203,7 @@ async def test_close_non_container(player, test_zone, mock_writer): """close on non-container thing gives feedback.""" from mudlib.commands.containers import cmd_close - rock = Thing(name="rock", location=test_zone, x=5, y=5) + _rock = Thing(name="rock", location=test_zone, x=5, y=5) await cmd_close(player, "rock") output = mock_writer.write.call_args_list[-1][0][0] assert "can't close" in output.lower()