Beispiel #1
0
def test_take_and_drop_mat_and_leaflet():
    adventure = Adventure()
    adventure.take(['mat'])
    adventure.open(['mailbox'])
    adventure.take(['leaflet'])
    assert(adventure.drop(['mat', 'leaflet']) == 'mat: Dropped.\nleaflet: Dropped.')
    assert(adventure.list_inventory([]) == 'You are empty handed.')
    assert(any((item.name == 'mat' or item.name == item.name == 'leaflet' for item in adventure.current_room.items)))
Beispiel #2
0
def test_house_read_leaflet_check_inventory():
    adventure = Adventure()
    adventure.open(['mailbox'])
    adventure.examine(['leaflet'])
    assert(adventure.list_inventory([]) == 'You are holding a small leaflet.')
Beispiel #3
0
def test_take_and_drop_mat():
    adventure = Adventure()
    adventure.take(['mat'])
    assert(adventure.drop(['mat']) == 'Dropped.')
    assert(adventure.list_inventory([]) == 'You are empty handed.')
    assert(any((item.name == 'mat' for item in adventure.current_room.items)))
Beispiel #4
0
def test_inventory_after_taking_mat_and_leaflet():
    adventure = Adventure()
    adventure.open(['mailbox'])
    adventure.take(['mat', 'leaflet'])
    assert(adventure.list_inventory([]) == """You are holding a welcome mat and a small leaflet.""")