Skip to content
This repository has been archived by the owner on Dec 7, 2022. It is now read-only.

Commit

Permalink
Take copied modulemd_defaults into consideration for module errata copy
Browse files Browse the repository at this point in the history
  • Loading branch information
dralley authored and kersommoura committed Aug 7, 2019
1 parent 73f0521 commit 6b0530f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -10,3 +10,4 @@ __pycache__/
/build/
/dist/
/pulp_2_tests.egg-info/
.idea/
3 changes: 2 additions & 1 deletion pulp_2_tests/constants.py
Expand Up @@ -149,7 +149,8 @@
'errata_id': 'RHEA-2012:0059',
'modules_count': 2,
'rpm_count': 2,
'total_available_units': 5,
'module_defaults_count': 2,
'total_available_units': 7,
}
)
"""The information about a Modular Errata with RPM artifacts.
Expand Down
17 changes: 15 additions & 2 deletions pulp_2_tests/tests/rpm/api_v2/test_modularity.py
Expand Up @@ -1441,6 +1441,7 @@ class ModularErrataCopyTestCase(unittest.TestCase):
Recursive copy of ``RHEA-2012:0059`` should copy:
* 2 modules: ``duck`` and ``kangaroo``.
* 2 modulemd_defaults ``duck`` and ``kangaroo``.
* 2 RPMS: ``kangaroo-0.3-1.noarch.rpm``, and ``duck-0.7-1.noarch.rpm``.
Exercise the use of ``recursive`` and ``recursive_conservative``.
Expand All @@ -1450,8 +1451,8 @@ class ModularErrataCopyTestCase(unittest.TestCase):
def setUpClass(cls):
"""Create class-wide variables."""
cls.cfg = config.get_config()
if cls.cfg.pulp_version < Version('2.19'):
raise unittest.SkipTest('This test requires Pulp 2.19 or newer.')
if cls.cfg.pulp_version < Version('2.21'):
raise unittest.SkipTest('This test requires Pulp 2.21 or newer.')
cls.client = api.Client(cls.cfg, api.json_handler)

def test_recursive_noconservative_nodependency(self):
Expand Down Expand Up @@ -1502,6 +1503,12 @@ def make_assertions_dependency(self, repo):
repo['content_unit_counts']
)

self.assertEqual(
repo['content_unit_counts']['modulemd_defaults'],
MODULE_FIXTURES_ERRATA['module_defaults_count'],
repo['content_unit_counts']
)

# older RPM package already present has to be added to total of RPM
# packages after copy.
self.assertEqual(
Expand All @@ -1524,6 +1531,12 @@ def make_assertions_nodependency(self, repo):
repo['content_unit_counts']
)

self.assertEqual(
repo['content_unit_counts']['modulemd_defaults'],
MODULE_FIXTURES_ERRATA['module_defaults_count'],
repo['content_unit_counts']
)

self.assertEqual(
repo['total_repository_units'],
MODULE_FIXTURES_ERRATA['total_available_units'],
Expand Down

0 comments on commit 6b0530f

Please sign in to comment.