diff options
author | Guido Günther <agx@sigxcpu.org> | 2015-08-27 20:01:25 +0200 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2015-08-27 20:01:25 +0200 |
commit | 20d3c1db89eb8ebd15b419e783095e47804bd939 (patch) | |
tree | dd90e17002b91206d1d7ae8d6bece9b49399fc11 /tests/component/deb/test_buildpackage.py | |
parent | f9a1ce1017cf8c1e261bfe1c7f744c616bf05525 (diff) |
Add simple component test for buildpackage
Diffstat (limited to 'tests/component/deb/test_buildpackage.py')
-rw-r--r-- | tests/component/deb/test_buildpackage.py | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/tests/component/deb/test_buildpackage.py b/tests/component/deb/test_buildpackage.py new file mode 100644 index 00000000..4204f643 --- /dev/null +++ b/tests/component/deb/test_buildpackage.py @@ -0,0 +1,48 @@ +# vim: set fileencoding=utf-8 : +# +# (C) 2015 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_dsc import main as import_dsc +from gbp.scripts.buildpackage import main as buildpackage + + +class TestBuildpackage(ComponentTestBase): + """Test building a debian package""" + + def test_debian_buildpackage(self): + """Test that building a native debian package 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') + os.chdir('git-buildpackage') + ret = buildpackage(['arg0', + '--git-builder=/bin/true', + '--git-cleaner=/bin/true']) + ok_(ret == 0, "Building the package failed") |