Ejemplo n.º 1
0
 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")
Ejemplo n.º 2
0
 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)
Ejemplo n.º 3
0
 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)
Ejemplo n.º 4
0
 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)
Ejemplo n.º 5
0
 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)
Ejemplo n.º 6
0
 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
Ejemplo n.º 7
0
 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/")
Ejemplo n.º 8
0
 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")
Ejemplo n.º 9
0
 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")
Ejemplo n.º 10
0
 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
Ejemplo n.º 11
0
 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/")
Ejemplo n.º 12
0
 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")