def test_name_then_off(self): with patch("sys.stdout", new=StringIO()) as out: robot_name = robot.get_robot_name() result = robot.get_command(robot_name) output = out.getvalue() + result self.assertEqual( output, "What do you want to name your robot? HAL: What must I do next? off" )
def test_caps_get_command(self): self.assertEqual(r.get_command('BRUCE'), "left")
def test_camel_get_command(self): self.assertEqual(r.get_command('BRUCE'), "forward 13")
def test_get_command(self): self.assertEqual(r.get_command('BRUCE'), "help")
def test_get_command(self): sys.stdout = StringIO() self.assertEqual(robot.get_command("Hal"), "forward 10")
def test_split_command_input(self): with captured_io(StringIO('back 5')): self.assertEqual(robot.get_command('back 5'), 'back 5')
def test_get_command(self): with captured_io(StringIO('Forward 10')): self.assertEqual(robot.get_command('Jay'), 'forward 10')