From 1c3f57e8f13d4f6dc818bdf06c3a40f768ef1ce5 Mon Sep 17 00:00:00 2001 From: Raman Tenneti Date: Tue, 4 May 2021 12:32:13 -0700 Subject: manifest_xml: initial support for It will be used to let manifest authors self-register contact info. This element can be repeated, and any later entries will clobber earlier ones. This would allow manifest authors who extend manifests to specify their own contact info. It would have 1 required attribute: bugurl. "bugurl" specifies the URL to file a bug against the manifest owner. TODO: This CL only implements the parsing logic and further work will be in followup CLs. Tested the code with the following commands. $ ./run_tests tests/test_manifest_xml.py $ ./run_tests -v Bug: [google internal] b/186220520. Change-Id: I47e765ba2dab5cdf850191129f4d4cd6b803f451 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/305203 Tested-by: Raman Tenneti Reviewed-by: Mike Frysinger --- tests/test_manifest_xml.py | 59 +++++++++++++++++++++++++++++----------------- 1 file changed, 38 insertions(+), 21 deletions(-) (limited to 'tests/test_manifest_xml.py') diff --git a/tests/test_manifest_xml.py b/tests/test_manifest_xml.py index e78d85c3..bfdf366e 100644 --- a/tests/test_manifest_xml.py +++ b/tests/test_manifest_xml.py @@ -255,10 +255,10 @@ class XmlManifestTests(ManifestParseTestCase): self.assertEqual(manifest.superproject['remote'].name, 'test-remote') self.assertEqual( manifest.ToXml().toxml(), - '' + - '' + - '' + - '' + + '' + '' + '' + '' '') @@ -409,10 +409,10 @@ class ProjectElementTests(ManifestParseTestCase): project.SetRevisionId('ABCDEF') self.assertEqual( manifest.ToXml().toxml(), - '' + - '' + - '' + - '' + + '' + '' + '' + '' '') def test_trailing_slash(self): @@ -517,10 +517,10 @@ class SuperProjectElementTests(ManifestParseTestCase): self.assertEqual(manifest.superproject['remote'].url, 'http://localhost/superproject') self.assertEqual( manifest.ToXml().toxml(), - '' + - '' + - '' + - '' + + '' + '' + '' + '' '') def test_remote(self): @@ -538,11 +538,11 @@ class SuperProjectElementTests(ManifestParseTestCase): self.assertEqual(manifest.superproject['remote'].url, 'http://localhost/platform/superproject') self.assertEqual( manifest.ToXml().toxml(), - '' + - '' + - '' + - '' + - '' + + '' + '' + '' + '' + '' '') def test_defalut_remote(self): @@ -558,8 +558,25 @@ class SuperProjectElementTests(ManifestParseTestCase): self.assertEqual(manifest.superproject['remote'].name, 'default-remote') self.assertEqual( manifest.ToXml().toxml(), - '' + - '' + - '' + - '' + + '' + '' + '' + '' '') + + +class ContactinfoElementTests(ManifestParseTestCase): + """Tests for .""" + + def test_contactinfo(self): + """Check contactinfo settings.""" + bugurl = 'http://localhost/contactinfo' + manifest = self.getXmlManifest(f""" + + + +""") + self.assertEqual(manifest.contactinfo['bugurl'], bugurl) + self.assertEqual( + manifest.ToXml().toxml(), + f"""""") -- cgit v1.2.3-54-g00ecf