diff options
author | Guido Günther <agx@sigxcpu.org> | 2013-04-26 23:13:29 +0200 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2013-04-26 23:23:02 +0200 |
commit | af138de213686bbd3f8fea1f27557462d4779243 (patch) | |
tree | 3b9fa62d71306c084b9ba24c2b9a586846316f15 /tests/14_test_gbp_import_dscs.py | |
parent | f9722f6bf8d2ac64b658ce499e2d47203f1df339 (diff) |
14_test_gbp_import_dscs: Mock gbp.log.err
to get rid of the spurious error message
Diffstat (limited to 'tests/14_test_gbp_import_dscs.py')
-rw-r--r-- | tests/14_test_gbp_import_dscs.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/14_test_gbp_import_dscs.py b/tests/14_test_gbp_import_dscs.py index 694d67ef..3e4772fa 100644 --- a/tests/14_test_gbp_import_dscs.py +++ b/tests/14_test_gbp_import_dscs.py @@ -17,10 +17,11 @@ from . import context -import os import testutils +import gbp.log import gbp.scripts.import_dscs as import_dscs +from gbp.errors import GbpError class StubGitImportDsc(object): """ @@ -55,13 +56,18 @@ def stub_parse_dsc(filename): import_dscs.GitImportDsc = StubGitImportDsc import_dscs.parse_dsc = stub_parse_dsc - class TestImportDscs(testutils.DebianGitTestRepo): """Test L{gbp.scripts.import_dscs}'s """ def setUp(self): testutils.DebianGitTestRepo.setUp(self) context.chdir(self.repo.path) + self.orig_err = gbp.log.err + gbp.log.err = self._check_err_msg + + def _check_err_msg(self, err): + self.assertIsInstance(err, GbpError) + self.assertIn("Failed to import", err.message) def test_import_success(self): """Test importing success with stub""" @@ -83,6 +89,7 @@ class TestImportDscs(testutils.DebianGitTestRepo): self.assertEqual(ret, 1) def tearDown(self): + gbp.log.err = self.orig_err testutils.DebianGitTestRepo.tearDown(self) context.teardown() |