diff options
author | Guido Günther <agx@sigxcpu.org> | 2017-12-31 16:40:21 +0100 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2017-12-31 16:46:48 +0100 |
commit | 0730a57db438b935bc7f16957650a6ef25589598 (patch) | |
tree | 622f8dd3bc2684f7f60483ea402398500e807084 /tests/08_test_patch.py | |
parent | 7b0660abab858938330553a1379df57b2a9b851b (diff) |
patch_series: Don't fail on decoding errors when looking for DEP3 headers
Closes: #885929
Diffstat (limited to 'tests/08_test_patch.py')
-rw-r--r-- | tests/08_test_patch.py | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/tests/08_test_patch.py b/tests/08_test_patch.py index bc9a507c..3ed16eba 100644 --- a/tests/08_test_patch.py +++ b/tests/08_test_patch.py @@ -7,7 +7,7 @@ from . import context # noqa: 401 import os import unittest -from gbp.patch_series import Patch +from gbp.patch_series import Patch, Dep3Patch class TestPatch(unittest.TestCase): @@ -38,3 +38,17 @@ class TestPatch(unittest.TestCase): "It can span several lines.\n", p.long_desc) self.assertEqual('Sat, 24 Dec 2011 12:05:53 +0100', p.date) + + +class TestDep3Patch(unittest.TestCase): + data_dir = os.path.splitext(__file__)[0] + '_data' + + def test_encoding(self): + """Make sure broken encoding does no affect import""" + patchfile = os.path.join(self.data_dir, "dep3-iso8859-1.patch") + self.assertTrue(os.path.exists(patchfile)) + p = Dep3Patch(patchfile) + self.assertEqual('Replace all -- in man page by \-\- to make lintian happy.', p.subject) + self.assertEqual("Roland Rosenfeld", p.author) + self.assertEqual("roland@debian.org", p.email) + self.assertEqual("", p.long_desc) |