diff options
Diffstat (limited to 'tests/test_manifest_xml.py')
| -rw-r--r-- | tests/test_manifest_xml.py | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/test_manifest_xml.py b/tests/test_manifest_xml.py index c1fed2bf..d4bf76a9 100644 --- a/tests/test_manifest_xml.py +++ b/tests/test_manifest_xml.py | |||
| @@ -488,6 +488,41 @@ class IncludeElementTests(ManifestParseTestCase): | |||
| 488 | # Check level2 proj group not removed. | 488 | # Check level2 proj group not removed. |
| 489 | self.assertIn("l2g1", proj.groups) | 489 | self.assertIn("l2g1", proj.groups) |
| 490 | 490 | ||
| 491 | def test_group_levels_with_extend_project(self): | ||
| 492 | root_m = self.manifest_dir / "root.xml" | ||
| 493 | root_m.write_text( | ||
| 494 | """ | ||
| 495 | <manifest> | ||
| 496 | <remote name="test-remote" fetch="http://localhost" /> | ||
| 497 | <default remote="test-remote" revision="refs/heads/main" /> | ||
| 498 | <include name="man1.xml" groups="top-group1" /> | ||
| 499 | <include name="man2.xml" groups="top-group2" /> | ||
| 500 | </manifest> | ||
| 501 | """ | ||
| 502 | ) | ||
| 503 | (self.manifest_dir / "man1.xml").write_text( | ||
| 504 | """ | ||
| 505 | <manifest> | ||
| 506 | <project name="project1" path="project1" /> | ||
| 507 | </manifest> | ||
| 508 | """ | ||
| 509 | ) | ||
| 510 | (self.manifest_dir / "man2.xml").write_text( | ||
| 511 | """ | ||
| 512 | <manifest> | ||
| 513 | <extend-project name="project1" groups="eg1" /> | ||
| 514 | </manifest> | ||
| 515 | """ | ||
| 516 | ) | ||
| 517 | include_m = manifest_xml.XmlManifest(str(self.repodir), str(root_m)) | ||
| 518 | proj = include_m.projects[0] | ||
| 519 | # Check project has inherited group via project element. | ||
| 520 | self.assertIn("top-group1", proj.groups) | ||
| 521 | # Check project has inherited group via extend-project element. | ||
| 522 | self.assertIn("top-group2", proj.groups) | ||
| 523 | # Check project has set group via extend-project element. | ||
| 524 | self.assertIn("eg1", proj.groups) | ||
| 525 | |||
| 491 | def test_allow_bad_name_from_user(self): | 526 | def test_allow_bad_name_from_user(self): |
| 492 | """Check handling of bad name attribute from the user's input.""" | 527 | """Check handling of bad name attribute from the user's input.""" |
| 493 | 528 | ||
