예제 #1
0
 def test(path):
     flo = Flo(path)
     try:
         user_input()
     except SystemExit:
         flo.old_print('no problemo')
     finally:
         flo._exit()
예제 #2
0
def test_user_input(file, dur, window, expected):
    """

    Args:
        file: file name
        dur: length of time data
        window: user input window to be tested
        expected: functions response to user input

    Returns: Pass or Fail

    """
    out = user_input(dur, window)
    assert expected == out
예제 #3
0
파일: game.py 프로젝트: amoibos/textadv
    def character_menu(self):  # need to be improved
        #self.player.details(self.round)

        for obj in self.player.macro_attributes():
            print("{0}: {1}: {2}".format(obj.ID(), obj.name(), obj.value()))
        print("\nYou have {0} Points left".format(self.player.get_attribute_points()))

        while True:
            if self.player.attribute_points >= 5:
              selection = user_input("Character attribute:")
              for obj in self.player.macro_attributes():
                if obj.is_ID(selection):
                    self.player.improve_attribute(obj)
                    break
            else:
                pause()
                clear()
                break
예제 #4
0
 def test_three(self):
     res = user_input(21, inp_func=input_single("3"))
     self.assertEqual(res, 3)
예제 #5
0
 def test_two(self):
     res = user_input(21, inp_func=input_single("2"))
     self.assertEqual(res, 2)
예제 #6
0
 def test_one(self):
     res = user_input(21, inp_func=input_single("1"))
     self.assertEqual(res, 1)