Fix unit tests for develop branch

This commit is contained in:
Griatch 2020-11-14 10:54:31 +01:00
parent cc809dd7e8
commit 36d8a16a80
3 changed files with 10 additions and 9 deletions

View file

@ -1184,8 +1184,8 @@ class TestCmdParser(TestCase):
@override_settings(SEARCH_MULTIMATCH_REGEX=r"(?P<number>[0-9]+)-(?P<name>.*)")
def test_num_prefixes(self):
self.assertEqual(cmdparser.try_num_prefixes("look me"), (None, None))
self.assertEqual(cmdparser.try_num_prefixes("3-look me"), ("3", "look me"))
self.assertEqual(cmdparser.try_num_prefixes("567-look me"), ("567", "look me"))
self.assertEqual(cmdparser.try_num_prefixes("look me-3"), ("3", "look me"))
self.assertEqual(cmdparser.try_num_prefixes("look me-567"), ("567", "look me"))
@override_settings(
SEARCH_MULTIMATCH_REGEX=r"(?P<number>[0-9]+)-(?P<name>.*)", CMD_IGNORE_PREFIXES="@&/+"

View file

@ -2403,7 +2403,7 @@ class TestPuzzles(CommandTest):
# try solving with multiple parts but incomplete set
self._use(
"1-steel, 2-steel", "You try to utilize these but nothing happens ... something amiss?"
"steel-1, steel-2", "You try to utilize these but nothing happens ... something amiss?"
)
# arm the other puzzle. Their parts are identical
@ -2414,7 +2414,7 @@ class TestPuzzles(CommandTest):
# multiple puzzles. Both can be solved but
# only one is.
self._use(
"1-steel, 2-flint, 3-steel, 3-flint",
"steel-1, flint-2, steel-3, flint-3",
"Your gears start turning and 2 different ideas come to your mind ... ",
)
self._check_room_contents({"steel": 2, "flint": 2, "fire": 2}, check_test_tags=True)
@ -2422,7 +2422,7 @@ class TestPuzzles(CommandTest):
self.room1.msg_contents = Mock()
# solve all
self._use("1-steel, 1-flint", "You are a Genius")
self._use("steel-1, flint-1", "You are a Genius")
self.room1.msg_contents.assert_called_once_with(
"|cChar|n performs some kind of tribal dance and |yfire|n seems to appear from thin air",
exclude=(self.char1,),
@ -2541,9 +2541,9 @@ class TestPuzzles(CommandTest):
self._arm(recipe_dbref, "makefire", ["steel", "flint", "red steel", "steel"])
self._check_room_contents({"steel": 2, "red steel": 1, "flint": 1})
self._use(
"1-steel, flint", "You try to utilize these but nothing happens ... something amiss?"
"steel-1, flint", "You try to utilize these but nothing happens ... something amiss?"
)
self._use("1-steel, flint, red steel, 3-steel", "You are a Genius")
self._use("steel-1, flint, red steel, steel-3", "You are a Genius")
self._check_room_contents({"smoke": 1, "fire": 1})
_box_all()
@ -2984,7 +2984,7 @@ class TestPuzzles(CommandTest):
}
)
self._use("1-battery, flashlight", "You are a Genius")
self._use("battery-1, flashlight", "You are a Genius")
self._check_room_contents(
{
"battery": 2,
@ -2995,7 +2995,7 @@ class TestPuzzles(CommandTest):
}
)
self._use("1-battery, flashlight-w-1", "You are a Genius")
self._use("battery-1, flashlight-w-1", "You are a Genius")
self._check_room_contents(
{
"battery": 1,

View file

@ -9,6 +9,7 @@ bcrypt >= 3.1.7
# Library for Telnet-SSL support
pyopenssl >= 19.1
service_identity >= 18.1.0
# AWS-storage contrib
boto3 >= 1.4.4