def test_equip_to_slot__non_equippable(): vial = factory.make("healing vial") e = Equipment() with pytest.raises(exceptions.Impossible): e.equip_to_slot(slot="WEAPON", item=vial)
def test_equip_to_slot__armor2weaponslot__raises_Impossible(leather_armor): # We should not be able to put armor in an weapon slot. e = Equipment() with pytest.raises(exceptions.Impossible): e.equip_to_slot(slot="WEAPON", item=leather_armor)
def test_equip_to_slot__weapon2armorslot__raises_Impossible(dagger): # We should not be able to put weapon in an armor slot. e = Equipment() with pytest.raises(exceptions.Impossible): e.equip_to_slot(slot="ARMOR", item=dagger)
def test_equip_to_slot__armor_to_armorslot(leather_armor): e = Equipment() e.equip_to_slot(slot="ARMOR", item=leather_armor) assert e.slots['ARMOR'] == leather_armor
def test_equip_to_slot__msg(dagger): e = Equipment() result = e.equip_to_slot(slot="WEAPON", item=dagger) assert result == 'You equip the dagger. '
def test_equip_to_slot__weapon_to_weaponslot(dagger): e = Equipment() e.equip_to_slot(slot="WEAPON", item=dagger) assert e.slots['WEAPON'] == dagger