From 4ab2284a945d82b017c6646fca57c5973ffdabaf Mon Sep 17 00:00:00 2001 From: Peter Kjellerstedt Date: Thu, 16 Oct 2025 20:29:28 +0200 Subject: manifest: Make extend-project support copyfile, linkfile and annotation This allows an existing project to be extended by these elements. Change-Id: I6826e518f39ca86485301491639101943b7e2ae0 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/519781 Reviewed-by: Mike Frysinger Tested-by: Peter Kjellerstedt Reviewed-by: Gavin Mak --- tests/test_manifest_xml.py | 78 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) (limited to 'tests') diff --git a/tests/test_manifest_xml.py b/tests/test_manifest_xml.py index ebc0ce58..07939e16 100644 --- a/tests/test_manifest_xml.py +++ b/tests/test_manifest_xml.py @@ -1214,6 +1214,84 @@ class ExtendProjectElementTests(ManifestParseTestCase): self.assertEqual(len(manifest.projects), 1) self.assertEqual(manifest.projects[0].upstream, "bar") + def test_extend_project_copyfiles(self): + manifest = self.getXmlManifest( + """ + + + + + + + + +""" + ) + self.assertEqual(manifest.projects[0].copyfiles[0].src, "foo") + self.assertEqual(manifest.projects[0].copyfiles[0].dest, "bar") + self.assertEqual( + sort_attributes(manifest.ToXml().toxml()), + '' + '' + '' + '' + '' + "" + "", + ) + + def test_extend_project_linkfiles(self): + manifest = self.getXmlManifest( + """ + + + + + + + + +""" + ) + self.assertEqual(manifest.projects[0].linkfiles[0].src, "foo") + self.assertEqual(manifest.projects[0].linkfiles[0].dest, "bar") + self.assertEqual( + sort_attributes(manifest.ToXml().toxml()), + '' + '' + '' + '' + '' + "" + "", + ) + + def test_extend_project_annotations(self): + manifest = self.getXmlManifest( + """ + + + + + + + + +""" + ) + self.assertEqual(manifest.projects[0].annotations[0].name, "foo") + self.assertEqual(manifest.projects[0].annotations[0].value, "bar") + self.assertEqual( + sort_attributes(manifest.ToXml().toxml()), + '' + '' + '' + '' + '' + "" + "", + ) + class NormalizeUrlTests(ManifestParseTestCase): """Tests for normalize_url() in manifest_xml.py""" -- cgit v1.2.3-54-g00ecf