Esempio n. 1
0
 def test_parse_path(self):
     path, _ = parse_path('R1,U1,L1,D1')
     self.assertEqual(path[0].A, [0,0])
     self.assertEqual(path[0].B, [1,0])
     self.assertEqual(path[-1].B, [0,1])
     self.assertEqual(path[-1].A, [0,0])
     self.assertEqual(len(path),4)
Esempio n. 2
0
 def test_no_launch(self):
     self.assertRaises(ValueError,
                       lambda: parse_path(PurePosixPath('file.launch')))
Esempio n. 3
0
 def test_extended_path(self):
     self.assertEqual(
         ParsedLaunchPath('simulator', 'file.launch'),
         parse_path(
             PurePosixPath('~/ros/workspace/simulator/launch/file.launch')))
Esempio n. 4
0
 def test_other_extension(self):
     self.assertEqual(
         ParsedLaunchPath('simulator', 'file.dat'),
         parse_path(PurePosixPath('simulator/launch/file.dat')))
Esempio n. 5
0
 def test_basic_xml(self):
     self.assertEqual(
         ParsedLaunchPath('simulator', 'file.launch.xml'),
         parse_path(PurePosixPath('simulator/launch/file.launch.xml')))
Esempio n. 6
0
 def test_ends_with_launch(self):
     self.assertRaises(
         ValueError, lambda: parse_path(PurePosixPath('simulator/launch')))
Esempio n. 7
0
 def test_starts_with_launch(self):
     self.assertRaises(
         ValueError, lambda: parse_path(
             PurePosixPath('launch/simulator/launch/file.launch')))
Esempio n. 8
0
 def test_two_launch(self):
     self.assertRaises(
         ValueError, lambda: parse_path(
             PurePosixPath('simulator/launch/include/launch/file.launch')))