Made evadventure unit tests pass again

This commit is contained in:
Griatch 2023-05-19 20:41:10 +02:00
parent 2a75ea8343
commit 431d1d85cb
3 changed files with 7 additions and 7 deletions

View file

@ -213,7 +213,7 @@ class EvAdventureWeapon(EvAdventureObject):
user.msg("You are not close enough to the target!")
return False
if self.quality <= 0:
if self.quality is not None and self.quality <= 0:
user.msg(f"{self.get_display_name(user)} is broken and can't be used!")
return False
return super().at_pre_use(user, target=target, *args, **kwargs)
@ -263,7 +263,7 @@ class EvAdventureWeapon(EvAdventureObject):
location.msg_contents(message, from_obj=attacker, mapping={target.key: target})
def at_post_use(self, user, *args, **kwargs):
if self.quality <= 0:
if self.quality is not None and self.quality <= 0:
user.msg(f"|r{self.get_display_name(user)} breaks and can no longer be used!")

View file

@ -48,7 +48,7 @@ Exits: north, northeast, east, southeast, south, southwest, west, and northwest"
result = "\n".join(part.rstrip() for part in strip_ansi(desc).split("\n"))
expected = "\n".join(part.rstrip() for part in expected.split("\n"))
print(result)
print(expected)
# print(result)
# print(expected)
self.assertEqual(result, expected)