From e28ea0740a7b4eb2ef4c1bd3079d77a40c6072b8 Mon Sep 17 00:00:00 2001 From: Guido Günther Date: Sun, 30 Oct 2011 20:03:33 +0100 Subject: Get rid of the symlink by moving the commands to gbp/scripts/ --- tests/01_test_help.py | 4 ++-- tests/02_test_import.py | 5 ++--- tests/04_test_gbp_submodules.py | 6 +++--- tests/05_test_detection.py | 22 +++++++++++----------- 4 files changed, 18 insertions(+), 19 deletions(-) (limited to 'tests') diff --git a/tests/01_test_help.py b/tests/01_test_help.py index 8d520694..02b19c8a 100644 --- a/tests/01_test_help.py +++ b/tests/01_test_help.py @@ -9,12 +9,12 @@ class TestHelp(unittest.TestCase): """Test help output of gbp commands""" def testHelp(self): for prog in [ "buildpackage", "import-orig", "import-dsc", "dch" ]: - ret = os.system("./git-%s --help >/dev/null" % prog) + ret = os.system("bin/git-%s --help >/dev/null" % prog) self.assertEqual(ret, 0) def testHelpGbp(self): for prog in [ "pull", "clone", "pq", "create-remote-repo" ]: - ret = os.system("./gbp-%s --help >/dev/null" % prog) + ret = os.system("bin/gbp-%s --help >/dev/null" % prog) self.assertEqual(ret, 0) # vim:et:ts=4:sw=4:et:sts=4:ai:set list listchars=tab\:»·,trail\:·: diff --git a/tests/02_test_import.py b/tests/02_test_import.py index f1e93c97..6ded95af 100644 --- a/tests/02_test_import.py +++ b/tests/02_test_import.py @@ -22,8 +22,7 @@ class TestUnpack: assert os.path.exists(target), "%s does not exist" % target def _create_archive(self, comp): - filelist = [ os.path.basename(f) for f in - glob.glob(os.path.join(self.top, "g*-*")) ] + filelist = [ 'README', 'setup.py' ] name = "%s_0.1.tar.%s" % (self.archive_prefix, comp) t = tarfile.open(name= name, mode='w:%s' % comp) @@ -70,7 +69,7 @@ class TestUnpack: self._check_files(archive[1], comp) def test_upstream_source_unpack_filtered(self): - exclude = "git-buildpackage" + exclude = "README" for (comp, archive) in self.archives.iteritems(): source = gbp.deb.UpstreamSource(archive[0]) diff --git a/tests/04_test_gbp_submodules.py b/tests/04_test_gbp_submodules.py index e69570eb..a20f668d 100644 --- a/tests/04_test_gbp_submodules.py +++ b/tests/04_test_gbp_submodules.py @@ -9,7 +9,7 @@ import gbp.log import gbp.git import gbp.command_wrappers -import git_buildpackage +from gbp.scripts import buildpackage top = None repo = None @@ -97,7 +97,7 @@ def test_dump_tree(): """Dump the repository and check if files exist""" dumpdir = os.path.join(tmpdir, "dump") os.mkdir(dumpdir) - assert git_buildpackage.dump_tree(repo, dumpdir, "master", True) + assert buildpackage.dump_tree(repo, dumpdir, "master", True) assert os.path.exists(os.path.join(dumpdir, testfile_name)) assert os.path.exists(os.path.join(dumpdir, submodules[0].name, testfile_name)) @@ -105,7 +105,7 @@ def test_dump_tree(): def test_create_tarball(): """Create an upstream tarball""" cp = { "Source": "test", "Upstream-Version": "0.1" } - assert git_buildpackage.git_archive(repo, + assert buildpackage.git_archive(repo, cp, tmpdir, "HEAD", diff --git a/tests/05_test_detection.py b/tests/05_test_detection.py index a60cab17..2f58265c 100644 --- a/tests/05_test_detection.py +++ b/tests/05_test_detection.py @@ -3,7 +3,7 @@ import shutil import tempfile import unittest -import git_buildpackage +from gbp.scripts import buildpackage from gbp.deb import has_orig from gbp.errors import GbpError @@ -31,14 +31,14 @@ class TestDetection(unittest.TestCase): def test_guess_comp_type_no_pristine_tar_no_orig(self): repo = MockGitRepository(with_branch=False) - guessed = git_buildpackage.guess_comp_type( + guessed = buildpackage.guess_comp_type( repo, 'auto', self.cp, self.tmpdir) self.assertEqual('gzip', guessed) def test_guess_comp_type_no_pristine_tar_with_orig(self): open(os.path.join(self.tmpdir, 'source_1.2.orig.tar.bz2'), "w").close() repo = MockGitRepository(with_branch=False) - guessed = git_buildpackage.guess_comp_type( + guessed = buildpackage.guess_comp_type( repo, 'auto', self.cp, self.tmpdir) self.assertEqual('bzip2', guessed) @@ -48,7 +48,7 @@ class TestDetection(unittest.TestCase): repo = MockGitRepository(with_branch=False) self.assertRaises( GbpError, - git_buildpackage.guess_comp_type, + buildpackage.guess_comp_type, repo, 'auto', self.cp, @@ -57,7 +57,7 @@ class TestDetection(unittest.TestCase): def test_guess_comp_type_auto_bzip2(self): subject = 'pristine-tar data for source_1.2-3.orig.tar.bz2' repo = MockGitRepository(with_branch=True, subject=subject) - guessed = git_buildpackage.guess_comp_type( + guessed = buildpackage.guess_comp_type( repo, 'auto', self.cp, self.tmpdir) self.assertEqual("bzip2", guessed) @@ -70,36 +70,36 @@ class TestDetection(unittest.TestCase): def test_guess_comp_type_bzip2(self): repo = MockGitRepository(with_branch=False) - guessed = git_buildpackage.guess_comp_type( + guessed = buildpackage.guess_comp_type( repo, 'bzip2', self.cp, None) self.assertEqual("bzip2", guessed) def test_guess_comp_type_gzip(self): repo = MockGitRepository(with_branch=False) - guessed = git_buildpackage.guess_comp_type( + guessed = buildpackage.guess_comp_type( repo, 'gzip', self.cp, None) self.assertEqual("gzip", guessed) def test_guess_comp_type_bz(self): repo = MockGitRepository(with_branch=False) - guessed = git_buildpackage.guess_comp_type( + guessed = buildpackage.guess_comp_type( repo, 'xz', self.cp, None) self.assertEqual("xz", guessed) def test_guess_comp_type_lzma(self): repo = MockGitRepository(with_branch=False) - guessed = git_buildpackage.guess_comp_type( + guessed = buildpackage.guess_comp_type( repo, 'lzma', self.cp, None) self.assertEqual("lzma", guessed) def test_guess_comp_type_bz2(self): repo = MockGitRepository(with_branch=False) - guessed = git_buildpackage.guess_comp_type( + guessed = buildpackage.guess_comp_type( repo, 'bz2', self.cp, None) self.assertEqual("bzip2", guessed) def test_guess_comp_type_gz(self): repo = MockGitRepository(with_branch=False) - guessed = git_buildpackage.guess_comp_type( + guessed = buildpackage.guess_comp_type( repo, 'gz', self.cp, None) self.assertEqual("gzip", guessed) -- cgit v1.2.3