Exemple #1
0
def test_take_and_drop_leaflet_and_mat_then_look():
    adventure = Adventure()
    adventure.open(['mailbox'])
    adventure.take(['leaflet', 'mat'])
    adventure.drop(['mat', 'leaflet'])
    assert(adventure.look([]) == """**West of House**
This is an open field west of a white house, with a boarded front door.
There is a small mailbox, a welcome mat, and a small leaflet here.""")
Exemple #2
0
def test_take_mat_go_north_then_drop_mat():
    adventure = Adventure()
    adventure.take(['mat'])
    adventure.go_north([])
    adventure.drop(['mat'])
    assert (adventure.current_room.description == """**North of House**
You are facing the north side of a white house.  There is no door here, and all the windows are barred.
There is a welcome mat here.""")
Exemple #3
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)))
Exemple #4
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)))