aboutsummaryrefslogtreecommitdiff
path: root/tests/component/deb/test_import_dsc.py
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2013-01-16 09:25:07 +0100
committerGuido Günther <agx@sigxcpu.org>2013-01-16 20:45:02 +0100
commit9ec98c54e162db94fb77ba619f1974f4e4c93d07 (patch)
tree680f4d7a89a0391376635beb7a70e652d44d4ab6 /tests/component/deb/test_import_dsc.py
parent3820adc5933e9f2ce5833500018746602389be3c (diff)
Move over import dsc test from external test suite
Move over the first test from our external (shell based) test suite to the component tests.
Diffstat (limited to 'tests/component/deb/test_import_dsc.py')
-rw-r--r--tests/component/deb/test_import_dsc.py52
1 files changed, 52 insertions, 0 deletions
diff --git a/tests/component/deb/test_import_dsc.py b/tests/component/deb/test_import_dsc.py
new file mode 100644
index 0000000..bccdb07
--- /dev/null
+++ b/tests/component/deb/test_import_dsc.py
@@ -0,0 +1,52 @@
+# vim: set fileencoding=utf-8 :
+#
+# (C) 2013 Guido Günther <agx@sigxcpu.org>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+import os
+
+from tests.component import (ComponentTestBase,
+ ComponentTestGitRepository)
+from tests.component.deb import DEB_TEST_DATA_DIR
+
+from gbp.scripts.import_dsc import main as import_dsc
+
+class TestImportDsc(ComponentTestBase):
+ """Test importing of src.rpm files"""
+
+ def test_debian_import(self):
+ """Test that importing of debian native packages works"""
+ def _dsc(version):
+ return os.path.join(DEB_TEST_DATA_DIR,
+ 'dsc-native',
+ 'git-buildpackage_%s.dsc' % version)
+
+ dsc = _dsc('0.4.14')
+ assert import_dsc(['arg0', dsc]) == 0
+ repo = ComponentTestGitRepository('git-buildpackage')
+ self._check_repo_state(repo, 'master', ['master'])
+ assert len(repo.get_commits()) == 1
+
+ os.chdir('git-buildpackage')
+ dsc = _dsc('0.4.15')
+ assert import_dsc(['arg0', dsc]) == 0
+ self._check_repo_state(repo, 'master', ['master'])
+ assert len(repo.get_commits()) == 2
+
+ dsc = _dsc('0.4.16')
+ assert import_dsc(['arg0', dsc]) == 0
+ self._check_repo_state(repo, 'master', ['master'])
+ assert len(repo.get_commits()) == 3