Add open and close commands for containers

This commit is contained in:
Jared Miller 2026-02-11 20:41:13 -05:00
parent b3471a8b94
commit 5b9a43617f
Signed by: shmup
GPG key ID: 22B5C6D66A38B06C
2 changed files with 6 additions and 4 deletions

View file

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

View file

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