summaryrefslogtreecommitdiffstats
path: root/tests/test_manifest_xml.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_manifest_xml.py')
-rw-r--r--tests/test_manifest_xml.py29
1 files changed, 28 insertions, 1 deletions
diff --git a/tests/test_manifest_xml.py b/tests/test_manifest_xml.py
index 96ee4c4a..59f2a779 100644
--- a/tests/test_manifest_xml.py
+++ b/tests/test_manifest_xml.py
@@ -286,6 +286,25 @@ class XmlManifestTests(ManifestParseTestCase):
286 '<superproject name="superproject"/>' 286 '<superproject name="superproject"/>'
287 '</manifest>') 287 '</manifest>')
288 288
289 def test_remote_annotations(self):
290 """Check remote settings."""
291 manifest = self.getXmlManifest("""
292<manifest>
293 <remote name="test-remote" fetch="http://localhost">
294 <annotation name="foo" value="bar"/>
295 </remote>
296</manifest>
297""")
298 self.assertEqual(manifest.remotes['test-remote'].annotations[0].name, 'foo')
299 self.assertEqual(manifest.remotes['test-remote'].annotations[0].value, 'bar')
300 self.assertEqual(
301 sort_attributes(manifest.ToXml().toxml()),
302 '<?xml version="1.0" ?><manifest>'
303 '<remote fetch="http://localhost" name="test-remote">'
304 '<annotation name="foo" value="bar"/>'
305 '</remote>'
306 '</manifest>')
307
289 308
290class IncludeElementTests(ManifestParseTestCase): 309class IncludeElementTests(ManifestParseTestCase):
291 """Tests for <include>.""" 310 """Tests for <include>."""
@@ -632,9 +651,17 @@ class RemoteElementTests(ManifestParseTestCase):
632 def test_remote(self): 651 def test_remote(self):
633 """Check remote settings.""" 652 """Check remote settings."""
634 a = manifest_xml._XmlRemote(name='foo') 653 a = manifest_xml._XmlRemote(name='foo')
635 b = manifest_xml._XmlRemote(name='bar') 654 a.AddAnnotation('key1', 'value1', 'true')
655 b = manifest_xml._XmlRemote(name='foo')
656 b.AddAnnotation('key2', 'value1', 'true')
657 c = manifest_xml._XmlRemote(name='foo')
658 c.AddAnnotation('key1', 'value2', 'true')
659 d = manifest_xml._XmlRemote(name='foo')
660 d.AddAnnotation('key1', 'value1', 'false')
636 self.assertEqual(a, a) 661 self.assertEqual(a, a)
637 self.assertNotEqual(a, b) 662 self.assertNotEqual(a, b)
663 self.assertNotEqual(a, c)
664 self.assertNotEqual(a, d)
638 self.assertNotEqual(a, manifest_xml._Default()) 665 self.assertNotEqual(a, manifest_xml._Default())
639 self.assertNotEqual(a, 123) 666 self.assertNotEqual(a, 123)
640 self.assertNotEqual(a, None) 667 self.assertNotEqual(a, None)