aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2017-07-18 20:18:54 +0200
committerGuido Günther <agx@sigxcpu.org>2017-07-18 20:21:34 +0200
commitaaee8bb0b2bdc9337d16b4c1d9b0b3303f91dd22 (patch)
tree88c409b825c38f1c980a63d2918bf1b2dd8124b2
parent9fc1774dfeba043b4bdf7c7535e640460e1e93cf (diff)
tests: add initial test for import-dsc
-rw-r--r--tests/component/deb/test_import_dscs.py46
1 files changed, 46 insertions, 0 deletions
diff --git a/tests/component/deb/test_import_dscs.py b/tests/component/deb/test_import_dscs.py
new file mode 100644
index 0000000..480d3de
--- /dev/null
+++ b/tests/component/deb/test_import_dscs.py
@@ -0,0 +1,46 @@
+# vim: set fileencoding=utf-8 :
+#
+# (C) 2017 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, please see
+# <http://www.gnu.org/licenses/>
+
+import os
+
+from tests.component import (ComponentTestBase,
+ ComponentTestGitRepository)
+from tests.component.deb import DEB_TEST_DATA_DIR
+from nose.tools import ok_
+
+from gbp.scripts.import_dscs import main as import_dscs
+
+
+class TestImportDscs(ComponentTestBase):
+ """Test importing of debian source packages"""
+
+ def test_import_debian_native(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)
+
+ dsc1 = _dsc('0.4.14')
+ dsc2 = _dsc('0.4.15')
+ assert import_dscs(['arg0', dsc1, dsc2]) == 0
+ repo = ComponentTestGitRepository('git-buildpackage')
+ self._check_repo_state(repo, 'master', ['master'])
+ assert len(repo.get_commits()) == 2
+ commitmsg = repo.get_commit_info('HEAD')['body']
+ ok_("git-buildpackage (0.4.15) unstable; urgency=low" in commitmsg)