Exemplo n.º 1
0
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)
Exemplo n.º 2
0
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)
Exemplo n.º 3
0
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)
Exemplo n.º 4
0
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
Exemplo n.º 5
0
def test_equip_to_slot__msg(dagger):
    e = Equipment()
    result = e.equip_to_slot(slot="WEAPON", item=dagger)
    assert result == 'You equip the dagger. '
Exemplo n.º 6
0
def test_equip_to_slot__weapon_to_weaponslot(dagger):
    e = Equipment()
    e.equip_to_slot(slot="WEAPON", item=dagger)
    assert e.slots['WEAPON'] == dagger