コード例 #1
0
def test_galaxy_man_satisfies_his_need_for_literary_immersion(ui):
    # Galaxy Man tries out the text adventure abd wants to see a
    # very interesting and immersive introduction to the game
    ui, engine = init_item_room(ui)

    # He starts it up and enters his name when prompted
    ui.say("begin")
    ui.say("Galaxy Man")
    ui.say("q")

    # Then he recieves a really spectacular introduction
    # describing the purpose of the game and includes an
    # indepth view of the game world.
    engine.main_loop()
    assert ui.output_anywhere("pork belly")
    assert ui.output_anywhere("to rescue the big pile of bacon")
    assert ui.output_anywhere("dark and moss covered room")
    assert ui.output_anywhere("with evil")
    assert ui.output_anywhere("the low-sodium cartel")
def test_galaxy_man_satisfies_his_need_for_literary_immersion(ui):
    # Galaxy Man tries out the text adventure abd wants to see a 
    # very interesting and immersive introduction to the game
    ui, engine = init_item_room(ui)

    # He starts it up and enters his name when prompted
    ui.say("begin")
    ui.say("Galaxy Man")
    ui.say("q")

    # Then he recieves a really spectacular introduction
    # describing the purpose of the game and includes an
    # indepth view of the game world.
    engine.main_loop()
    assert ui.output_anywhere("pork belly")
    assert ui.output_anywhere("to rescue the big pile of bacon")
    assert ui.output_anywhere("dark and moss covered room")
    assert ui.output_anywhere("with evil")
    assert ui.output_anywhere("the low-sodium cartel")
def test_ian_inventory_can_see_all_items_on_map(ui):
    ui, engine = init_item_room(ui)
    # Ian walks into a room filled with lots of stuff and he wants to see the map
    # Ian wants to know all of the stuff in the room and definately wants to see everything
    # on the map
    # He types begin and enters the game
    ui.say("begin")
    ui.say("Ian")
    
    # The map displays all items in the room.  Ian sees the exit is one square south.
    # He moves there and exits
    ui.say("k")
    ui.say("e")

    # Having seen all there is to see, he quits the game and tells all of his friends about
    # the cool map.
    ui.say("q")
    engine.main_loop()
    assert ui.output_anywhere("....G")
    assert ui.output_anywhere("$...*")
    assert ui.output_anywhere("~....")
    assert ui.output_anywhere("<....")
    assert ui.output_anywhere("@....")
コード例 #4
0
def test_ian_inventory_can_see_all_items_on_map(ui):
    ui, engine = init_item_room(ui)
    # Ian walks into a room filled with lots of stuff and he wants to see the map
    # Ian wants to know all of the stuff in the room and definately wants to see everything
    # on the map
    # He types begin and enters the game
    ui.say("begin")
    ui.say("Ian")

    # The map displays all items in the room.  Ian sees the exit is one square south.
    # He moves there and exits
    ui.say("k")
    ui.say("e")

    # Having seen all there is to see, he quits the game and tells all of his friends about
    # the cool map.
    ui.say("q")
    engine.main_loop()
    assert ui.output_anywhere("....G")
    assert ui.output_anywhere("$...*")
    assert ui.output_anywhere("~....")
    assert ui.output_anywhere("<....")
    assert ui.output_anywhere("@....")