コード例 #1
0
 def test_get_single(self, rest_api, package):
     """Tests correct updates using GET with single package."""
     name, expected = package
     updates = rest_api.get_update(name).response_check()
     schemas.updates_top_schema.validate(updates.raw.body)
     assert len(updates) == 1
     package, = updates
     tools.validate_package_updates(package, expected, exact_match=True)
コード例 #2
0
ファイル: test_updates.py プロジェクト: mkoura/vmaas_tests
 def test_get(self, rest_api, package_record):
     """Tests updates using GET with single package."""
     name, expected_updates = package_record
     updates = rest_api.get_update(name).response_check()
     schemas.updates_top_schema.validate(updates.raw.body)
     assert len(updates) == 1
     package, = updates
     tools.validate_package_updates(package, expected_updates)
コード例 #3
0
 def test_post_single(self, rest_api, package):
     """Tests correct updates from noarch using POST with single package."""
     name, expected = package
     body = tools.gen_updates_body([name])
     updates = rest_api.get_updates(body=body).response_check()
     schemas.updates_top_schema.validate(updates.raw.body)
     assert len(updates) == 1
     package, = updates
     tools.validate_package_updates(package, expected, exact_match=True)
コード例 #4
0
ファイル: test_updates.py プロジェクト: mkoura/vmaas_tests
 def test_post_single(self, rest_api, package_record):
     """Tests updates using POST with single package."""
     name, expected_updates = package_record
     request_body = tools.gen_updates_body([name])
     updates = rest_api.get_updates(body=request_body).response_check()
     schemas.updates_top_schema.validate(updates.raw.body)
     assert len(updates) == 1
     package, = updates
     tools.validate_package_updates(package, expected_updates)
コード例 #5
0
 def test_post_multi(self, rest_api):
     """Tests updates in repos using POST with multiple packages."""
     request_body = tools.gen_updates_body([p[0] for p in PACKAGES_W_REPOS], repositories=REPOS)
     updates = rest_api.get_updates(body=request_body).response_check()
     schemas.updates_top_repolist_schema.validate(updates.raw.body)
     assert len(updates) == len(PACKAGES_W_REPOS)
     for package_name, expected_updates in PACKAGES_W_REPOS:
         package = updates[package_name]
         tools.validate_package_updates(package, expected_updates)
コード例 #6
0
 def test_get_single(self, rest_api, package):
     """Tests correct updates in different repo using GET with single package."""
     name, expected = package
     if name in ('test-vmaas-0.3-3.x86_64') and GH(280).blocks:
         pytest.skip('Blocked by GH 280')
     updates = rest_api.get_update(name).response_check()
     schemas.updates_top_schema.validate(updates.raw.body)
     assert len(updates) == 1
     package, = updates
     tools.validate_package_updates(package, expected, exact_match=True)
コード例 #7
0
 def test_post_multi(self, rest_api):
     """Tests correct updates using POST with multiple packages."""
     body = tools.gen_updates_body([p[0] for p in packages.PACKAGES_BASIC])
     updates = rest_api.get_updates(body=body).response_check()
     schemas.updates_top_schema.validate(updates.raw.body)
     assert len(updates) == len(packages.PACKAGES_BASIC)
     for name, expected in packages.PACKAGES_BASIC:
         tools.validate_package_updates(updates[name],
                                        expected,
                                        exact_match=True)
コード例 #8
0
 def test_post_single(self, rest_api, package):
     """Tests correct updates to noarch package using POST with single package."""
     name, expected = package
     if name in ('test-vmaas-0.3-3.x86_64') and GH(280).blocks:
         pytest.skip('Blocked by GH 280')
     body = tools.gen_updates_body([name])
     updates = rest_api.get_updates(body=body).response_check()
     schemas.updates_top_schema.validate(updates.raw.body)
     assert len(updates) == 1
     package, = updates
     tools.validate_package_updates(package, expected, exact_match=True)
コード例 #9
0
ファイル: test_updates.py プロジェクト: mkoura/vmaas_tests
 def test_post_single(self, rest_api, package_record):
     """Tests updates with filtered basearch using POST with single package."""
     name, expected_updates = package_record
     request_body = tools.gen_updates_body([name], basearch='i386')
     updates = rest_api.get_updates(body=request_body).response_check()
     schemas.updates_top_basearch_schema.validate(updates.raw.body)
     assert len(updates) == 1
     package, = updates
     tools.validate_package_updates(package, expected_updates)
     for update in package.available_updates:
         assert update['basearch'] == request_body['basearch']
コード例 #10
0
ファイル: test_updates.py プロジェクト: mkoura/vmaas_tests
 def test_post_multi(self, rest_api):
     """Tests updates with filtered release version using POST with multiple packages."""
     request_body = tools.gen_updates_body(
         [p[0] for p in packages.PACKAGES_RELEASE_FILTER], releasever='6')
     updates = rest_api.get_updates(body=request_body).response_check()
     schemas.updates_top_releasever_schema.validate(updates.raw.body)
     assert len(updates) == len(packages.PACKAGES_RELEASE_FILTER)
     for package_name, expected_updates in packages.PACKAGES_RELEASE_FILTER:
         package = updates[package_name]
         tools.validate_package_updates(package, expected_updates)
         for update in package.available_updates:
             assert update['releasever'] == request_body['releasever']
コード例 #11
0
ファイル: test_updates.py プロジェクト: mkoura/vmaas_tests
 def test_post_single(self, rest_api, package_record):
     """Tests updates in repos using POST with single package."""
     name, expected_updates = package_record
     request_body = tools.gen_updates_body(
         [name], repositories=packages.REPOS)
     updates = rest_api.get_updates(body=request_body).response_check()
     schemas.updates_top_repolist_schema.validate(updates.raw.body)
     assert len(updates) == 1
     package, = updates
     tools.validate_package_updates(package, expected_updates)
     for update in package.available_updates:
         assert update['repository'] in packages.REPOS
コード例 #12
0
 def test_post_multi(self, rest_api):
     """Tests correct updates from i386 package with basearch set to x86_64
     using POST with multiple packages.
     """
     body = tools.gen_updates_body(
         [p[0] for p in packages.PACKAGES_I386_W_FILTER], basearch='x86_64')
     updates = rest_api.get_updates(body=body).response_check()
     schemas.updates_top_basearch_schema.validate(updates.raw.body)
     assert len(updates) == len(packages.PACKAGES_I386_W_FILTER)
     for name, expected in packages.PACKAGES_I386_W_FILTER:
         tools.validate_package_updates(updates[name],
                                        expected,
                                        exact_match=True)
コード例 #13
0
 def test_post_single(self, rest_api, package):
     """Tests correct updates from i386 package with basearch set to x86_64
     using POST with single package.
     """
     name, expected = package
     if name in ('test-arch-vmaas-1-1.i386',
                 'test-arch-vmaas-2-2.i386') and GH(273).blocks:
         pytest.skip('Blocked by GH 273')
     body = tools.gen_updates_body([name], basearch='x86_64')
     updates = rest_api.get_updates(body=body).response_check()
     schemas.updates_top_basearch_schema.validate(updates.raw.body)
     assert len(updates) == 1
     package, = updates
     tools.validate_package_updates(package, expected, exact_match=True)