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)
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)
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)
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)
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)
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)
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)
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)
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']
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']
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
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)
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)