diff options
Diffstat (limited to 'tests/test_manifest_xml.py')
-rw-r--r-- | tests/test_manifest_xml.py | 59 |
1 files changed, 38 insertions, 21 deletions
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): | |||
255 | self.assertEqual(manifest.superproject['remote'].name, 'test-remote') | 255 | self.assertEqual(manifest.superproject['remote'].name, 'test-remote') |
256 | self.assertEqual( | 256 | self.assertEqual( |
257 | manifest.ToXml().toxml(), | 257 | manifest.ToXml().toxml(), |
258 | '<?xml version="1.0" ?><manifest>' + | 258 | '<?xml version="1.0" ?><manifest>' |
259 | '<remote name="test-remote" fetch="http://localhost"/>' + | 259 | '<remote name="test-remote" fetch="http://localhost"/>' |
260 | '<default remote="test-remote" revision="refs/heads/main"/>' + | 260 | '<default remote="test-remote" revision="refs/heads/main"/>' |
261 | '<superproject name="superproject"/>' + | 261 | '<superproject name="superproject"/>' |
262 | '</manifest>') | 262 | '</manifest>') |
263 | 263 | ||
264 | 264 | ||
@@ -409,10 +409,10 @@ class ProjectElementTests(ManifestParseTestCase): | |||
409 | project.SetRevisionId('ABCDEF') | 409 | project.SetRevisionId('ABCDEF') |
410 | self.assertEqual( | 410 | self.assertEqual( |
411 | manifest.ToXml().toxml(), | 411 | manifest.ToXml().toxml(), |
412 | '<?xml version="1.0" ?><manifest>' + | 412 | '<?xml version="1.0" ?><manifest>' |
413 | '<remote name="default-remote" fetch="http://localhost"/>' + | 413 | '<remote name="default-remote" fetch="http://localhost"/>' |
414 | '<default remote="default-remote" revision="refs/heads/main"/>' + | 414 | '<default remote="default-remote" revision="refs/heads/main"/>' |
415 | '<project name="test-name" revision="ABCDEF"/>' + | 415 | '<project name="test-name" revision="ABCDEF"/>' |
416 | '</manifest>') | 416 | '</manifest>') |
417 | 417 | ||
418 | def test_trailing_slash(self): | 418 | def test_trailing_slash(self): |
@@ -517,10 +517,10 @@ class SuperProjectElementTests(ManifestParseTestCase): | |||
517 | self.assertEqual(manifest.superproject['remote'].url, 'http://localhost/superproject') | 517 | self.assertEqual(manifest.superproject['remote'].url, 'http://localhost/superproject') |
518 | self.assertEqual( | 518 | self.assertEqual( |
519 | manifest.ToXml().toxml(), | 519 | manifest.ToXml().toxml(), |
520 | '<?xml version="1.0" ?><manifest>' + | 520 | '<?xml version="1.0" ?><manifest>' |
521 | '<remote name="test-remote" fetch="http://localhost"/>' + | 521 | '<remote name="test-remote" fetch="http://localhost"/>' |
522 | '<default remote="test-remote" revision="refs/heads/main"/>' + | 522 | '<default remote="test-remote" revision="refs/heads/main"/>' |
523 | '<superproject name="superproject"/>' + | 523 | '<superproject name="superproject"/>' |
524 | '</manifest>') | 524 | '</manifest>') |
525 | 525 | ||
526 | def test_remote(self): | 526 | def test_remote(self): |
@@ -538,11 +538,11 @@ class SuperProjectElementTests(ManifestParseTestCase): | |||
538 | self.assertEqual(manifest.superproject['remote'].url, 'http://localhost/platform/superproject') | 538 | self.assertEqual(manifest.superproject['remote'].url, 'http://localhost/platform/superproject') |
539 | self.assertEqual( | 539 | self.assertEqual( |
540 | manifest.ToXml().toxml(), | 540 | manifest.ToXml().toxml(), |
541 | '<?xml version="1.0" ?><manifest>' + | 541 | '<?xml version="1.0" ?><manifest>' |
542 | '<remote name="default-remote" fetch="http://localhost"/>' + | 542 | '<remote name="default-remote" fetch="http://localhost"/>' |
543 | '<remote name="superproject-remote" fetch="http://localhost"/>' + | 543 | '<remote name="superproject-remote" fetch="http://localhost"/>' |
544 | '<default remote="default-remote" revision="refs/heads/main"/>' + | 544 | '<default remote="default-remote" revision="refs/heads/main"/>' |
545 | '<superproject name="platform/superproject" remote="superproject-remote"/>' + | 545 | '<superproject name="platform/superproject" remote="superproject-remote"/>' |
546 | '</manifest>') | 546 | '</manifest>') |
547 | 547 | ||
548 | def test_defalut_remote(self): | 548 | def test_defalut_remote(self): |
@@ -558,8 +558,25 @@ class SuperProjectElementTests(ManifestParseTestCase): | |||
558 | self.assertEqual(manifest.superproject['remote'].name, 'default-remote') | 558 | self.assertEqual(manifest.superproject['remote'].name, 'default-remote') |
559 | self.assertEqual( | 559 | self.assertEqual( |
560 | manifest.ToXml().toxml(), | 560 | manifest.ToXml().toxml(), |
561 | '<?xml version="1.0" ?><manifest>' + | 561 | '<?xml version="1.0" ?><manifest>' |
562 | '<remote name="default-remote" fetch="http://localhost"/>' + | 562 | '<remote name="default-remote" fetch="http://localhost"/>' |
563 | '<default remote="default-remote" revision="refs/heads/main"/>' + | 563 | '<default remote="default-remote" revision="refs/heads/main"/>' |
564 | '<superproject name="superproject"/>' + | 564 | '<superproject name="superproject"/>' |
565 | '</manifest>') | 565 | '</manifest>') |
566 | |||
567 | |||
568 | class ContactinfoElementTests(ManifestParseTestCase): | ||
569 | """Tests for <contactinfo>.""" | ||
570 | |||
571 | def test_contactinfo(self): | ||
572 | """Check contactinfo settings.""" | ||
573 | bugurl = 'http://localhost/contactinfo' | ||
574 | manifest = self.getXmlManifest(f""" | ||
575 | <manifest> | ||
576 | <contactinfo bugurl="{bugurl}"/> | ||
577 | </manifest> | ||
578 | """) | ||
579 | self.assertEqual(manifest.contactinfo['bugurl'], bugurl) | ||
580 | self.assertEqual( | ||
581 | manifest.ToXml().toxml(), | ||
582 | f"""<?xml version="1.0" ?><manifest><contactinfo bugurl="{bugurl}"/></manifest>""") | ||