def test(path): flo = Flo(path) try: user_input() except SystemExit: flo.old_print('no problemo') finally: flo._exit()
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
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
def test_three(self): res = user_input(21, inp_func=input_single("3")) self.assertEqual(res, 3)
def test_two(self): res = user_input(21, inp_func=input_single("2")) self.assertEqual(res, 2)
def test_one(self): res = user_input(21, inp_func=input_single("1")) self.assertEqual(res, 1)