Пример #1
0
 def test_split_command_input(self):
     with captured_io(StringIO("")):
         self.assertEqual(robot.split_command_input("forward 10"),
                          ("forward", "10"))
         self.assertEqual(robot.split_command_input("back 5"),
                          ("back", "5"))
         self.assertEqual(robot.split_command_input("right"), ("right", ""))
         self.assertEqual(robot.split_command_input("left"), ("left", ""))
         self.assertEqual(robot.split_command_input("sprint"),
                          ("sprint", ""))
         self.assertEqual(robot.split_command_input("replay"),
                          ("replay", ""))
         self.assertEqual(robot.split_command_input("replay silent"),
                          ("replay", "silent"))
         self.assertEqual(robot.split_command_input("replay reversed"),
                          ("replay", "reversed"))
         self.assertEqual(
             robot.split_command_input("replay reversed silent"),
             ("replay", "reversed silent"))
Пример #2
0
 def test_split_command_input(self):
     command = "forward 13"
     self.assertEqual(r.split_command_input(command), ('forward', '13'))
Пример #3
0
 def test_split_command_input(self):
     command = "left"
     self.assertEqual(r.split_command_input(command), ("left", ''))
Пример #4
0
 def test_command_split(self):
     self.assertEqual(robot.split_command_input("forward 10"),
                      ('forward', '10'))
Пример #5
0
 def test_split_command_input(self):
     with patch("sys.stdout", new=StringIO()) as var:
         robot.split_command_input("forward 10")
         output = var.getvalue().strip()
         self.assertEqual(output, """""")