diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_git_superproject.py | 12 | ||||
| -rw-r--r-- | tests/test_manifest_xml.py | 6 |
2 files changed, 14 insertions, 4 deletions
diff --git a/tests/test_git_superproject.py b/tests/test_git_superproject.py index 07b9a7db..9550949b 100644 --- a/tests/test_git_superproject.py +++ b/tests/test_git_superproject.py | |||
| @@ -15,6 +15,7 @@ | |||
| 15 | """Unittests for the git_superproject.py module.""" | 15 | """Unittests for the git_superproject.py module.""" |
| 16 | 16 | ||
| 17 | import os | 17 | import os |
| 18 | import platform | ||
| 18 | import tempfile | 19 | import tempfile |
| 19 | import unittest | 20 | import unittest |
| 20 | from unittest import mock | 21 | from unittest import mock |
| @@ -34,6 +35,7 @@ class SuperprojectTestCase(unittest.TestCase): | |||
| 34 | self.manifest_file = os.path.join( | 35 | self.manifest_file = os.path.join( |
| 35 | self.repodir, manifest_xml.MANIFEST_FILE_NAME) | 36 | self.repodir, manifest_xml.MANIFEST_FILE_NAME) |
| 36 | os.mkdir(self.repodir) | 37 | os.mkdir(self.repodir) |
| 38 | self.platform = platform.system().lower() | ||
| 37 | 39 | ||
| 38 | # The manifest parsing really wants a git repo currently. | 40 | # The manifest parsing really wants a git repo currently. |
| 39 | gitdir = os.path.join(self.repodir, 'manifests.git') | 41 | gitdir = os.path.join(self.repodir, 'manifests.git') |
| @@ -48,8 +50,8 @@ class SuperprojectTestCase(unittest.TestCase): | |||
| 48 | <remote name="default-remote" fetch="http://localhost" /> | 50 | <remote name="default-remote" fetch="http://localhost" /> |
| 49 | <default remote="default-remote" revision="refs/heads/main" /> | 51 | <default remote="default-remote" revision="refs/heads/main" /> |
| 50 | <superproject name="superproject"/> | 52 | <superproject name="superproject"/> |
| 51 | <project path="art" name="platform/art" /> | 53 | <project path="art" name="platform/art" groups="notdefault,platform-""" + self.platform + """ |
| 52 | </manifest> | 54 | " /></manifest> |
| 53 | """) | 55 | """) |
| 54 | self._superproject = git_superproject.Superproject(manifest, self.repodir) | 56 | self._superproject = git_superproject.Superproject(manifest, self.repodir) |
| 55 | 57 | ||
| @@ -142,7 +144,8 @@ class SuperprojectTestCase(unittest.TestCase): | |||
| 142 | '<?xml version="1.0" ?><manifest>' + | 144 | '<?xml version="1.0" ?><manifest>' + |
| 143 | '<remote name="default-remote" fetch="http://localhost"/>' + | 145 | '<remote name="default-remote" fetch="http://localhost"/>' + |
| 144 | '<default remote="default-remote" revision="refs/heads/main"/>' + | 146 | '<default remote="default-remote" revision="refs/heads/main"/>' + |
| 145 | '<project name="platform/art" path="art" revision="ABCDEF"/>' + | 147 | '<project name="platform/art" path="art" revision="ABCDEF" ' + |
| 148 | 'groups="notdefault,platform-' + self.platform + '"/>' + | ||
| 146 | '<superproject name="superproject"/>' + | 149 | '<superproject name="superproject"/>' + |
| 147 | '</manifest>') | 150 | '</manifest>') |
| 148 | 151 | ||
| @@ -169,7 +172,8 @@ class SuperprojectTestCase(unittest.TestCase): | |||
| 169 | '<remote name="default-remote" fetch="http://localhost"/>' + | 172 | '<remote name="default-remote" fetch="http://localhost"/>' + |
| 170 | '<default remote="default-remote" revision="refs/heads/main"/>' + | 173 | '<default remote="default-remote" revision="refs/heads/main"/>' + |
| 171 | '<project name="platform/art" path="art" ' + | 174 | '<project name="platform/art" path="art" ' + |
| 172 | 'revision="2c2724cb36cd5a9cec6c852c681efc3b7c6b86ea"/>' + | 175 | 'revision="2c2724cb36cd5a9cec6c852c681efc3b7c6b86ea" ' + |
| 176 | 'groups="notdefault,platform-' + self.platform + '"/>' + | ||
| 173 | '<superproject name="superproject"/>' + | 177 | '<superproject name="superproject"/>' + |
| 174 | '</manifest>') | 178 | '</manifest>') |
| 175 | 179 | ||
diff --git a/tests/test_manifest_xml.py b/tests/test_manifest_xml.py index 6977b417..9060ef3d 100644 --- a/tests/test_manifest_xml.py +++ b/tests/test_manifest_xml.py | |||
| @@ -15,6 +15,7 @@ | |||
| 15 | """Unittests for the manifest_xml.py module.""" | 15 | """Unittests for the manifest_xml.py module.""" |
| 16 | 16 | ||
| 17 | import os | 17 | import os |
| 18 | import platform | ||
| 18 | import shutil | 19 | import shutil |
| 19 | import tempfile | 20 | import tempfile |
| 20 | import unittest | 21 | import unittest |
| @@ -377,6 +378,11 @@ class ProjectElementTests(ManifestParseTestCase): | |||
| 377 | self.assertCountEqual( | 378 | self.assertCountEqual( |
| 378 | result['extras'], | 379 | result['extras'], |
| 379 | ['g1', 'g2', 'g1', 'name:extras', 'all', 'path:path']) | 380 | ['g1', 'g2', 'g1', 'name:extras', 'all', 'path:path']) |
| 381 | groupstr = 'default,platform-' + platform.system().lower() | ||
| 382 | self.assertEqual(groupstr, manifest.GetGroupsStr()) | ||
| 383 | groupstr = 'g1,g2,g1' | ||
| 384 | manifest.manifestProject.config.SetString('manifest.groups', groupstr) | ||
| 385 | self.assertEqual(groupstr, manifest.GetGroupsStr()) | ||
| 380 | 386 | ||
| 381 | def test_set_revision_id(self): | 387 | def test_set_revision_id(self): |
| 382 | """Check setting of project's revisionId.""" | 388 | """Check setting of project's revisionId.""" |
