Commit 2320ac35 authored by Guido Günther's avatar Guido Günther

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.
parent 03accd29
......@@ -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)
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
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