def test_get_release_index_flat(self): """ Get release index file contents, flat. :return: """ repo = DpkgRepo("http://dummy/url") assert repo.get_release_index() == "Plasma conduit overflow" assert repo.is_flat()
def test_get_release_index_exception(self): """ Get release index file contents, other than flat or standard error code. :return: """ repo = DpkgRepo("http://dummy/url") with pytest.raises(GeneralRepoException) as exc: assert repo.get_release_index() assert str(exc.value) == "HTTP error 204 occurred while connecting to the URL"
def test_get_release_index_standard(self): """ Get release index file contents, standard and skip GPG verification. :return: """ repo = DpkgRepo("http://dummy/url", gpg_verify=False) with patch("spacewalk.common.repo.DpkgRepo._has_valid_gpg_signature", MagicMock()) as gpg_check: assert repo.get_release_index() == "Plasma conduit overflow" assert not repo.is_flat() assert not gpg_check.called