def test_redirect_to_a_directory_path(self, session): session.commit() query = Repo.query.filter_by(status='ready') result = util.get_repo_url(query, 'x86_64', path=["SRPMS", "repodata", "repomd.xml"], repo_file=False) assert result.endswith("/SRPMS/repodata/repomd.xml")
def repo(self, **kw): repo_url = get_repo_url( self.repo_query, kw.get('arch'), ) if not repo_url: abort(504, "no repository is ready for: %s/%s" % (self.project.name, self.ref_name)) redirect(repo_url)
def repo(self, **kw): repo_url = get_repo_url( self.repo_query, kw.get('arch'), ) if not repo_url: abort( 504, "no repository is ready for: %s/%s" % (self.project.name, self.ref_name)) redirect(repo_url)
def _default(self, arch, *args): repo_url = get_repo_url( self.repo_query, arch, path=args, repo_file=False, ) if not repo_url: abort(504, "no repository is ready for: %s/%s" % (self.project.name, self.ref_name)) redirect(repo_url)
def _default(self, arch, *args): repo_url = get_repo_url( self.repo_query, arch, path=args, repo_file=False, ) if not repo_url: abort( 504, "no repository is ready for: %s/%s" % (self.project.name, self.ref_name)) redirect(repo_url)
def test_repo_not_found(self, session): session.commit() query = Repo.query.filter_by(status='queued') result = util.get_repo_url(query, None, repo_file=False) assert not result
def test_arch_is_none(self, session): session.commit() query = Repo.query.filter_by(status='ready') result = util.get_repo_url(query, None, repo_file=False) assert result.startswith("chacra.ceph.com/r/")
def test_repo_file_is_true(self, session): session.commit() query = Repo.query.filter_by(status='ready') result = util.get_repo_url(query, 'x86_64', repo_file=True) assert result.endswith("/repo")