Ejemplo n.º 1
0
 def git_tag_test(self):
     """Test creating an archive from a git tag"""
     git_repo = toml.loads("""
         [[repos.git]]
         rpmname="git-rpm-test"
         rpmversion="1.0.0"
         rpmrelease="1"
         summary="Testing the git rpm code"
         repo="file://%s"
         ref="v1.1.0"
         destination="/srv/testing-rpm/"
     """ % (self.repodir))
     archive = GitArchiveTarball(git_repo["repos"]["git"][0])
     self._check_tar(archive, "git-rpm-test/", "second")
Ejemplo n.º 2
0
 def git_branch_test(self):
     """Test creating an archive from a git branch"""
     git_repo = toml.loads("""
         [[repos.git]]
         rpmname="git-rpm-test"
         rpmversion="1.0.0"
         rpmrelease="1"
         summary="Testing the git rpm code"
         repo="file://%s"
         ref="origin/custom-branch"
         destination="/srv/testing-rpm/"
     """ % self.repodir)
     archive = GitArchiveTarball(git_repo["repos"]["git"][0])
     self._check_tar(archive, "git-rpm-test/", "branch")
Ejemplo n.º 3
0
 def test_git_commit(self):
     """Test creating an archive from a git commit hash"""
     git_repo = toml.loads("""
         [[repos.git]]
         rpmname="git-rpm-test"
         rpmversion="1.0.0"
         rpmrelease="1"
         summary="Testing the git rpm code"
         repo="file://%s"
         ref="%s"
         destination="/srv/testing-rpm/"
     """ % (self.repodir, self.first_commit))
     archive = GitArchiveTarball(git_repo["repos"]["git"][0])
     self._check_tar(archive, "git-rpm-test/", "first")
Ejemplo n.º 4
0
 def git_fail_ref_test(self):
     """Test creating an archive from a bad ref"""
     git_repo = toml.loads("""
         [[repos.git]]
         rpmname="git-rpm-test"
         rpmversion="1.0.0"
         rpmrelease="1"
         summary="Testing the git rpm code"
         repo="file://%s"
         ref="0297617d7b8baa263a69ae7dc901bbbcefd0eaa4"
         destination="/srv/testing-rpm/"
     """ % (self.repodir))
     with self.assertRaises(RuntimeError):
         archive = GitArchiveTarball(git_repo["repos"]["git"][0])
         self._check_tar(archive, "git-rpm-test/", None)
Ejemplo n.º 5
0
 def git_fail_repo_test(self):
     """Test creating an archive from a bad url"""
     git_repo = toml.loads("""
         [[repos.git]]
         rpmname="git-rpm-test"
         rpmversion="1.0.0"
         rpmrelease="1"
         summary="Testing the git rpm code"
         repo="file://%s"
         ref="v1.1.0"
         destination="/srv/testing-rpm/"
     """ % ("/tmp/no-repo-here/"))
     with self.assertRaises(RuntimeError):
         archive = GitArchiveTarball(git_repo["repos"]["git"][0])
         self._check_tar(archive, "git-rpm-test/", None)