def __init__(self, name, hp, inventory=None, gold=10, weapon=None, coords=(0, 0)): """@ReturnType Player""" self._inventory = inventory or [] """@AttributeType Item*""" self._gold = gold """@AttributeType Int""" self._weapon = weapon or Weapon.create() self._coords = coords super(Player, self).__init__(name, hp)
def test_create(): wep = Weapon.create() assert 1 <= wep.getDamage() <= 5 assert wep.appraise() == wep.getDamage() and 1 <= wep.appraise() <= 5 assert wep.identify() != None assert wep.describe() != None