summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2013-01-04 18:40:51 +0200
committerMarkus Lehtonen <markus.lehtonen@linux.intel.com>2013-04-03 10:11:41 +0300
commita633e70ccb21db9480a78e6e46e6b5d1960d6669 (patch)
tree597d3e5de2791c14b5fbbbac5bab145891bfdf53
parent7a47ae84c93273a7016093aa4456908a788afcf2 (diff)
downloadgit-buildpackage-a633e70ccb21db9480a78e6e46e6b5d1960d6669.tar.gz
git-buildpackage-a633e70ccb21db9480a78e6e46e6b5d1960d6669.tar.bz2
git-buildpackage-a633e70ccb21db9480a78e6e46e6b5d1960d6669.zip
test_import_srpm: add checks for files in repo
Enhance some tests by checking that the correct files are present in the working directory of the repo. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
-rw-r--r--tests/component/rpm/test_import_srpm.py32
1 files changed, 25 insertions, 7 deletions
diff --git a/tests/component/rpm/test_import_srpm.py b/tests/component/rpm/test_import_srpm.py
index 5430c3cb..1a9d0c68 100644
--- a/tests/component/rpm/test_import_srpm.py
+++ b/tests/component/rpm/test_import_srpm.py
@@ -46,7 +46,9 @@ class TestImportPacked(ComponentTestBase):
assert import_srpm(['arg0', srpm]) == 0
# Check repository state
repo = GitRepository('gbp-test')
- self._check_repo_state(repo, 'master', ['master', 'upstream'])
+ files = {'Makefile', 'README', 'bar.tar.gz', 'dummy.sh', 'foo.txt',
+ 'gbp-test.spec', 'my.patch', 'mydir/', 'mydir/myfile.txt'}
+ self._check_repo_state(repo, 'master', ['master', 'upstream'], files)
# Four commits: upstream, packaging files, one patch and the removal
# of imported patches
assert len(repo.get_commits()) == 4
@@ -57,7 +59,11 @@ class TestImportPacked(ComponentTestBase):
assert import_srpm(['arg0', srpm]) == 0
# Check repository state
repo = GitRepository('gbp-test2')
- self._check_repo_state(repo, 'master', ['master', 'upstream'])
+ files = {'Makefile', 'README', 'bar.tar.gz', 'dummy.sh', 'foo.txt',
+ 'gbp-test2.spec', 'gbp-test2-alt.spec', 'my.patch', 'mydir/',
+ 'mydir/myfile.txt'}
+ self._check_repo_state(repo, 'master', ['master', 'upstream'], files)
+
# Four commits: upstream, packaging files, one patch and the removal
# of imported patches
assert len(repo.get_commits()) == 4
@@ -71,17 +77,21 @@ class TestImportPacked(ComponentTestBase):
assert import_srpm(['arg0', '--orphan-packaging', srpm]) == 0
# Check repository state
repo = GitRepository('gbp-test2')
- self._check_repo_state(repo, 'master', ['master', 'upstream'])
+ files = {'bar.tar.gz', 'foo.txt', 'gbp-test2.spec',
+ 'gbp-test2-alt.spec', 'my.patch', 'my2.patch', 'my3.patch'}
+ self._check_repo_state(repo, 'master', ['master', 'upstream'], files)
# Only one commit: the packaging files
assert len(repo.get_commits()) == 1
def test_basic_native_import(self):
"""Test importing of native src.rpm"""
- srpm = os.path.join(DATA_DIR, 'gbp-test2-2.0-0.src.rpm')
+ srpm = os.path.join(DATA_DIR, 'gbp-test-native-1.0-1.src.rpm')
assert import_srpm(['arg0', '--native', srpm]) == 0
# Check repository state
- repo = GitRepository('gbp-test2')
- self._check_repo_state(repo, 'master', ['master'])
+ files = {'.gbp.conf', 'Makefile', 'README', 'dummy.sh', 'packaging/',
+ 'packaging/gbp-test-native.spec'}
+ repo = GitRepository('gbp-test-native')
+ self._check_repo_state(repo, 'master', ['master'], files)
# Only one commit: the imported source tarball
assert len(repo.get_commits()) == 1
@@ -114,6 +124,9 @@ class TestImportPacked(ComponentTestBase):
assert len(repo.get_commits(until='upstream')) == 1
# Import new version
assert import_srpm(['arg0', srpms[2]]) == 0
+ files = {'Makefile', 'README', 'bar.tar.gz', 'dummy.sh', 'foo.txt',
+ 'gbp-test.spec', 'my.patch', 'mydir/', 'mydir/myfile.txt'}
+ self._check_repo_state(repo, 'master', ['master', 'upstream'], files)
assert len(repo.get_commits()) == 11
assert len(repo.get_commits(until='upstream')) == 2
# Check number of tags
@@ -169,7 +182,12 @@ class TestImportPacked(ComponentTestBase):
srpm]) == 0
# Check repository state
repo = GitRepository('gbp-test2')
- self._check_repo_state(repo, 'pack', ['pack', 'orig'])
+ files = {'Makefile', 'README', 'dummy.sh', 'packaging/',
+ 'packaging/bar.tar.gz', 'packaging/foo.txt',
+ 'packaging/gbp-test2.spec', 'packaging/gbp-test2-alt.spec',
+ 'packaging/my.patch', 'packaging/my2.patch',
+ 'packaging/my3.patch'}
+ self._check_repo_state(repo, 'pack', ['pack', 'orig'], files)
assert len(repo.get_commits()) == 2
# Check packaging dir
assert len(repo.get_commits(paths='packaging')) == 1