Commit f1b878c9 authored by Markus Lehtonen's avatar Markus Lehtonen Committed by Guido Günther

tests: enable unittests without devscripts

Add some additional skipIf statements, checking for the existence of the
debchange tool. Makes it possible to run unit tests in an environment
that doesn't have devscripts installed.
Signed-off-by: 's avatarMarkus Lehtonen <markus.lehtonen@linux.intel.com>
parent 042f422c
...@@ -8,6 +8,7 @@ also make up the API documentation. ...@@ -8,6 +8,7 @@ also make up the API documentation.
""" """
from . import context # noqa: 401 from . import context # noqa: 401
from . testutils import skip_without_cmd
import os import os
import unittest import unittest
...@@ -29,6 +30,7 @@ class TestQuoting(unittest.TestCase): ...@@ -29,6 +30,7 @@ class TestQuoting(unittest.TestCase):
self.assertEquals(cl.email, 'agx@sigxcpu.org') self.assertEquals(cl.email, 'agx@sigxcpu.org')
@skip_without_cmd('debchange')
class Test(unittest.TestCase): class Test(unittest.TestCase):
def setUp(self): def setUp(self):
self.tmpdir = context.new_tmpdir(__name__) self.tmpdir = context.new_tmpdir(__name__)
......
...@@ -27,6 +27,7 @@ from tests.component import (ComponentTestBase, ...@@ -27,6 +27,7 @@ from tests.component import (ComponentTestBase,
from tests.component.deb import DEB_TEST_DATA_DIR from tests.component.deb import DEB_TEST_DATA_DIR
from tests.component.deb.fixtures import (RepoFixtures, from tests.component.deb.fixtures import (RepoFixtures,
DEFAULT_OVERLAY) DEFAULT_OVERLAY)
from tests.testutils import skip_without_cmd
from nose.tools import ok_, eq_, assert_false, assert_true from nose.tools import ok_, eq_, assert_false, assert_true
...@@ -289,6 +290,7 @@ class TestBuildpackage(ComponentTestBase): ...@@ -289,6 +290,7 @@ class TestBuildpackage(ComponentTestBase):
repo.checkout("master") repo.checkout("master")
eq_(repo.rev_parse('master~^{}'), repo.rev_parse('debian/2.8-1^{}')) eq_(repo.rev_parse('master~^{}'), repo.rev_parse('debian/2.8-1^{}'))
@skip_without_cmd('debchange')
@RepoFixtures.quilt30() @RepoFixtures.quilt30()
def test_broken_upstream_version(self, repo): def test_broken_upstream_version(self, repo):
cl = ChangeLog(filename='debian/changelog') cl = ChangeLog(filename='debian/changelog')
......
...@@ -21,6 +21,7 @@ import os ...@@ -21,6 +21,7 @@ import os
from tests.component import ComponentTestBase from tests.component import ComponentTestBase
from tests.component.deb import DEB_TEST_DATA_DIR from tests.component.deb import DEB_TEST_DATA_DIR
from tests.component.deb.fixtures import RepoFixtures from tests.component.deb.fixtures import RepoFixtures
from tests.testutils import skip_without_cmd
import gbp.scripts.dch import gbp.scripts.dch
from gbp.scripts.dch import main as dch from gbp.scripts.dch import main as dch
...@@ -35,6 +36,7 @@ def _dsc_file(pkg, version, dir='dsc-3.0'): ...@@ -35,6 +36,7 @@ def _dsc_file(pkg, version, dir='dsc-3.0'):
DEFAULT_DSC = _dsc_file('hello-debhelper', '2.6-2') DEFAULT_DSC = _dsc_file('hello-debhelper', '2.6-2')
@skip_without_cmd('debchange')
class TestDch(ComponentTestBase): class TestDch(ComponentTestBase):
"""Test importing of new upstream versions""" """Test importing of new upstream versions"""
pkg = "hello-debhelper" pkg = "hello-debhelper"
......
...@@ -22,6 +22,7 @@ import subprocess ...@@ -22,6 +22,7 @@ import subprocess
from tests.component import ComponentTestBase from tests.component import ComponentTestBase
from tests.component.deb.fixtures import RepoFixtures from tests.component.deb.fixtures import RepoFixtures
from tests.testutils import skip_without_cmd
from gbp.git import GitRepository from gbp.git import GitRepository
from gbp.scripts.push import main as push from gbp.scripts.push import main as push
...@@ -91,6 +92,7 @@ class TestPush(ComponentTestBase): ...@@ -91,6 +92,7 @@ class TestPush(ComponentTestBase):
self.assertEquals(push(['argv0']), 1) self.assertEquals(push(['argv0']), 1)
self._check_log(-2, ".*You are not on branch 'master' but on 'foo'") self._check_log(-2, ".*You are not on branch 'master' but on 'foo'")
@skip_without_cmd('debchange')
@RepoFixtures.quilt30() @RepoFixtures.quilt30()
def test_dont_push_unreleased(self, repo): def test_dont_push_unreleased(self, repo):
repo.add_remote_repo('origin', self.target.path) repo.add_remote_repo('origin', self.target.path)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment