diff options
author | Guido Günther <agx@sigxcpu.org> | 2018-05-21 13:27:58 +0200 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2018-08-24 08:43:59 +0200 |
commit | 2320ac35f9582aee1542e420ca3f227dc1a6caab (patch) | |
tree | 6847b4731b73c32cbc18f91edc3a9c7454762af3 | |
parent | 03accd298de99757077bf72f8d6f3b76a6b3f6a7 (diff) |
Add test case for conversion of extra DEP-3 headers to pseudo-headers
Currently the extra DEP-3 headers may end up as trailers instead of
should be pseudo-headers.
-rw-r--r-- | tests/08_test_patch.py | 15 | ||||
-rw-r--r-- | tests/08_test_patch_data/dep3-longdesc-bug.patch | 9 |
2 files changed, 24 insertions, 0 deletions
diff --git a/tests/08_test_patch.py b/tests/08_test_patch.py index 3ed16eba..ff1760cb 100644 --- a/tests/08_test_patch.py +++ b/tests/08_test_patch.py @@ -52,3 +52,18 @@ class TestDep3Patch(unittest.TestCase): self.assertEqual("Roland Rosenfeld", p.author) self.assertEqual("roland@debian.org", p.email) self.assertEqual("", p.long_desc) + + def test_pseudo_headers(self): + """Convert extra DEP-3 header into a git pseudo-header""" + patchfile = os.path.join(self.data_dir, "dep3-longdesc-bug.patch") + self.assertTrue(os.path.exists(patchfile)) + p = Dep3Patch(patchfile) + self.assertEqual('Summary', p.subject) + self.assertEqual("Ben Hutchings", p.author) + self.assertEqual("ben@decadent.org.uk", p.email) + self.assertEqual("""\ +Bug: https://bugs.example.org/123456 + +Long description +""", + p.long_desc) diff --git a/tests/08_test_patch_data/dep3-longdesc-bug.patch b/tests/08_test_patch_data/dep3-longdesc-bug.patch new file mode 100644 index 00000000..bb4b7a88 --- /dev/null +++ b/tests/08_test_patch_data/dep3-longdesc-bug.patch @@ -0,0 +1,9 @@ +Author: Ben Hutchings <ben@decadent.org.uk> +Description: Summary + Long description +Bug: https://bugs.example.org/123456 + +--- /dev/null ++++ b/foo +@@ -0,0 +1,1 @@ ++foo |