diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_manifest_xml.py | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/tests/test_manifest_xml.py b/tests/test_manifest_xml.py index d53ea568..e4adf3c9 100644 --- a/tests/test_manifest_xml.py +++ b/tests/test_manifest_xml.py | |||
@@ -221,6 +221,65 @@ class XmlManifestTests(unittest.TestCase): | |||
221 | self.assertEqual(manifest.repo_hooks_project.name, 'repohooks') | 221 | self.assertEqual(manifest.repo_hooks_project.name, 'repohooks') |
222 | self.assertEqual(manifest.repo_hooks_project.enabled_repo_hooks, ['a', 'b']) | 222 | self.assertEqual(manifest.repo_hooks_project.enabled_repo_hooks, ['a', 'b']) |
223 | 223 | ||
224 | def test_superproject(self): | ||
225 | """Check superproject settings.""" | ||
226 | manifest = self.getXmlManifest(""" | ||
227 | <manifest> | ||
228 | <remote name="test-remote" fetch="http://localhost" /> | ||
229 | <default remote="test-remote" revision="refs/heads/main" /> | ||
230 | <superproject name="superproject"/> | ||
231 | </manifest> | ||
232 | """) | ||
233 | self.assertEqual(manifest.superproject['name'], 'superproject') | ||
234 | self.assertEqual(manifest.superproject['remote'].name, 'test-remote') | ||
235 | self.assertEqual( | ||
236 | manifest.ToXml().toxml(), | ||
237 | '<?xml version="1.0" ?><manifest>' + | ||
238 | '<remote name="test-remote" fetch="http://localhost"/>' + | ||
239 | '<default remote="test-remote" revision="refs/heads/main"/>' + | ||
240 | '<superproject name="superproject"/>' + | ||
241 | '</manifest>') | ||
242 | |||
243 | def test_superproject_with_remote(self): | ||
244 | """Check superproject settings.""" | ||
245 | manifest = self.getXmlManifest(""" | ||
246 | <manifest> | ||
247 | <remote name="default-remote" fetch="http://localhost" /> | ||
248 | <remote name="test-remote" fetch="http://localhost" /> | ||
249 | <default remote="default-remote" revision="refs/heads/main" /> | ||
250 | <superproject name="superproject" remote="test-remote"/> | ||
251 | </manifest> | ||
252 | """) | ||
253 | self.assertEqual(manifest.superproject['name'], 'superproject') | ||
254 | self.assertEqual(manifest.superproject['remote'].name, 'test-remote') | ||
255 | self.assertEqual( | ||
256 | manifest.ToXml().toxml(), | ||
257 | '<?xml version="1.0" ?><manifest>' + | ||
258 | '<remote name="default-remote" fetch="http://localhost"/>' + | ||
259 | '<remote name="test-remote" fetch="http://localhost"/>' + | ||
260 | '<default remote="default-remote" revision="refs/heads/main"/>' + | ||
261 | '<superproject name="superproject" remote="test-remote"/>' + | ||
262 | '</manifest>') | ||
263 | |||
264 | def test_superproject_with_defalut_remote(self): | ||
265 | """Check superproject settings.""" | ||
266 | manifest = self.getXmlManifest(""" | ||
267 | <manifest> | ||
268 | <remote name="default-remote" fetch="http://localhost" /> | ||
269 | <default remote="default-remote" revision="refs/heads/main" /> | ||
270 | <superproject name="superproject" remote="default-remote"/> | ||
271 | </manifest> | ||
272 | """) | ||
273 | self.assertEqual(manifest.superproject['name'], 'superproject') | ||
274 | self.assertEqual(manifest.superproject['remote'].name, 'default-remote') | ||
275 | self.assertEqual( | ||
276 | manifest.ToXml().toxml(), | ||
277 | '<?xml version="1.0" ?><manifest>' + | ||
278 | '<remote name="default-remote" fetch="http://localhost"/>' + | ||
279 | '<default remote="default-remote" revision="refs/heads/main"/>' + | ||
280 | '<superproject name="superproject"/>' + | ||
281 | '</manifest>') | ||
282 | |||
224 | def test_project_group(self): | 283 | def test_project_group(self): |
225 | """Check project group settings.""" | 284 | """Check project group settings.""" |
226 | manifest = self.getXmlManifest(""" | 285 | manifest = self.getXmlManifest(""" |