diff options
Diffstat (limited to 'tests/test_manifest_xml.py')
| -rw-r--r-- | tests/test_manifest_xml.py | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/tests/test_manifest_xml.py b/tests/test_manifest_xml.py index ef511055..1015e114 100644 --- a/tests/test_manifest_xml.py +++ b/tests/test_manifest_xml.py | |||
| @@ -996,6 +996,44 @@ class RemoveProjectElementTests(ManifestParseTestCase): | |||
| 996 | ) | 996 | ) |
| 997 | self.assertEqual(manifest.projects, []) | 997 | self.assertEqual(manifest.projects, []) |
| 998 | 998 | ||
| 999 | def test_remove_using_path_attrib(self): | ||
| 1000 | manifest = self.getXmlManifest( | ||
| 1001 | """ | ||
| 1002 | <manifest> | ||
| 1003 | <remote name="default-remote" fetch="http://localhost" /> | ||
| 1004 | <default remote="default-remote" revision="refs/heads/main" /> | ||
| 1005 | <project name="project1" path="tests/path1" /> | ||
| 1006 | <project name="project1" path="tests/path2" /> | ||
| 1007 | <project name="project2" /> | ||
| 1008 | <project name="project3" /> | ||
| 1009 | <project name="project4" path="tests/path3" /> | ||
| 1010 | <project name="project4" path="tests/path4" /> | ||
| 1011 | <project name="project5" /> | ||
| 1012 | <project name="project6" path="tests/path6" /> | ||
| 1013 | |||
| 1014 | <remove-project name="project1" path="tests/path2" /> | ||
| 1015 | <remove-project name="project3" /> | ||
| 1016 | <remove-project name="project4" /> | ||
| 1017 | <remove-project path="project5" /> | ||
| 1018 | <remove-project path="tests/path6" /> | ||
| 1019 | </manifest> | ||
| 1020 | """ | ||
| 1021 | ) | ||
| 1022 | found_proj1_path1 = False | ||
| 1023 | found_proj2 = False | ||
| 1024 | for proj in manifest.projects: | ||
| 1025 | if proj.name == "project1": | ||
| 1026 | found_proj1_path1 = True | ||
| 1027 | self.assertEqual(proj.relpath, "tests/path1") | ||
| 1028 | if proj.name == "project2": | ||
| 1029 | found_proj2 = True | ||
| 1030 | self.assertNotEqual(proj.name, "project3") | ||
| 1031 | self.assertNotEqual(proj.name, "project4") | ||
| 1032 | self.assertNotEqual(proj.name, "project5") | ||
| 1033 | self.assertNotEqual(proj.name, "project6") | ||
| 1034 | self.assertTrue(found_proj1_path1) | ||
| 1035 | self.assertTrue(found_proj2) | ||
| 1036 | |||
| 999 | 1037 | ||
| 1000 | class ExtendProjectElementTests(ManifestParseTestCase): | 1038 | class ExtendProjectElementTests(ManifestParseTestCase): |
| 1001 | """Tests for <extend-project>.""" | 1039 | """Tests for <extend-project>.""" |
