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.py78
1 files changed, 78 insertions, 0 deletions
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):
1214 self.assertEqual(len(manifest.projects), 1) 1214 self.assertEqual(len(manifest.projects), 1)
1215 self.assertEqual(manifest.projects[0].upstream, "bar") 1215 self.assertEqual(manifest.projects[0].upstream, "bar")
1216 1216
1217 def test_extend_project_copyfiles(self):
1218 manifest = self.getXmlManifest(
1219 """
1220<manifest>
1221 <remote name="default-remote" fetch="http://localhost" />
1222 <default remote="default-remote" revision="refs/heads/main" />
1223 <project name="myproject" />
1224 <extend-project name="myproject">
1225 <copyfile src="foo" dest="bar" />
1226 </extend-project>
1227</manifest>
1228"""
1229 )
1230 self.assertEqual(manifest.projects[0].copyfiles[0].src, "foo")
1231 self.assertEqual(manifest.projects[0].copyfiles[0].dest, "bar")
1232 self.assertEqual(
1233 sort_attributes(manifest.ToXml().toxml()),
1234 '<?xml version="1.0" ?><manifest>'
1235 '<remote fetch="http://localhost" name="default-remote"/>'
1236 '<default remote="default-remote" revision="refs/heads/main"/>'
1237 '<project name="myproject">'
1238 '<copyfile dest="bar" src="foo"/>'
1239 "</project>"
1240 "</manifest>",
1241 )
1242
1243 def test_extend_project_linkfiles(self):
1244 manifest = self.getXmlManifest(
1245 """
1246<manifest>
1247 <remote name="default-remote" fetch="http://localhost" />
1248 <default remote="default-remote" revision="refs/heads/main" />
1249 <project name="myproject" />
1250 <extend-project name="myproject">
1251 <linkfile src="foo" dest="bar" />
1252 </extend-project>
1253</manifest>
1254"""
1255 )
1256 self.assertEqual(manifest.projects[0].linkfiles[0].src, "foo")
1257 self.assertEqual(manifest.projects[0].linkfiles[0].dest, "bar")
1258 self.assertEqual(
1259 sort_attributes(manifest.ToXml().toxml()),
1260 '<?xml version="1.0" ?><manifest>'
1261 '<remote fetch="http://localhost" name="default-remote"/>'
1262 '<default remote="default-remote" revision="refs/heads/main"/>'
1263 '<project name="myproject">'
1264 '<linkfile dest="bar" src="foo"/>'
1265 "</project>"
1266 "</manifest>",
1267 )
1268
1269 def test_extend_project_annotations(self):
1270 manifest = self.getXmlManifest(
1271 """
1272<manifest>
1273 <remote name="default-remote" fetch="http://localhost" />
1274 <default remote="default-remote" revision="refs/heads/main" />
1275 <project name="myproject" />
1276 <extend-project name="myproject">
1277 <annotation name="foo" value="bar" />
1278 </extend-project>
1279</manifest>
1280"""
1281 )
1282 self.assertEqual(manifest.projects[0].annotations[0].name, "foo")
1283 self.assertEqual(manifest.projects[0].annotations[0].value, "bar")
1284 self.assertEqual(
1285 sort_attributes(manifest.ToXml().toxml()),
1286 '<?xml version="1.0" ?><manifest>'
1287 '<remote fetch="http://localhost" name="default-remote"/>'
1288 '<default remote="default-remote" revision="refs/heads/main"/>'
1289 '<project name="myproject">'
1290 '<annotation name="foo" value="bar"/>'
1291 "</project>"
1292 "</manifest>",
1293 )
1294
1217 1295
1218class NormalizeUrlTests(ManifestParseTestCase): 1296class NormalizeUrlTests(ManifestParseTestCase):
1219 """Tests for normalize_url() in manifest_xml.py""" 1297 """Tests for normalize_url() in manifest_xml.py"""