Add tickerhandler-free character class for tests

This commit is contained in:
FlutterSprite 2017-12-10 18:52:34 -08:00 committed by GitHub
parent 1420c8773e
commit f738427ff3

View file

@ -593,6 +593,16 @@ class TBItemsCharacter(DefaultCharacter):
# Tick down condition durations # Tick down condition durations
condition_tickdown(self, self) condition_tickdown(self, self)
class TBItemsCharacterTest(TBItemsCharacter):
"""
Just like the TBItemsCharacter, but doesn't subscribe to the TickerHandler.
This makes it easier to run unit tests on.
"""
def at_object_creation(self):
self.db.max_hp = 100 # Set maximum HP to 100
self.db.hp = self.db.max_hp # Set current HP to maximum
self.db.conditions = {} # Set empty dict for conditions
""" """
---------------------------------------------------------------------------- ----------------------------------------------------------------------------