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)
def test_no_launch(self): self.assertRaises(ValueError, lambda: parse_path(PurePosixPath('file.launch')))
def test_extended_path(self): self.assertEqual( ParsedLaunchPath('simulator', 'file.launch'), parse_path( PurePosixPath('~/ros/workspace/simulator/launch/file.launch')))
def test_other_extension(self): self.assertEqual( ParsedLaunchPath('simulator', 'file.dat'), parse_path(PurePosixPath('simulator/launch/file.dat')))
def test_basic_xml(self): self.assertEqual( ParsedLaunchPath('simulator', 'file.launch.xml'), parse_path(PurePosixPath('simulator/launch/file.launch.xml')))
def test_ends_with_launch(self): self.assertRaises( ValueError, lambda: parse_path(PurePosixPath('simulator/launch')))
def test_starts_with_launch(self): self.assertRaises( ValueError, lambda: parse_path( PurePosixPath('launch/simulator/launch/file.launch')))
def test_two_launch(self): self.assertRaises( ValueError, lambda: parse_path( PurePosixPath('simulator/launch/include/launch/file.launch')))