Code review comment for lp:~toshio/bzr/allow-dirty-patches

Revision history for this message
Toshio Kuratomi (toshio) wrote :

> I thought I'd add a test for this as patch pilot, so I put in this one based
> on bug 502076:
>
> def test_parse_leading_noise(self):
> """Parse a valid patch header"""
> # https://bugs.edge.launchpad.net/bzr/+bug/502076
> lines = ["diff -pruN commands.py",
> "--- orig/commands.py"
> "+++ mod/dommands.py"]
> bits = parse_patch(iter(lines), allow_dirty=True)
>
> however this fails with

> Can someone tell me what format this is supposed to be parsing, or what's
> wrong with that test?

Thanks for the test -- there's two problems with this patch:
1) Call parse_patches() instead of parse_patch():
   bits = parse_patch(iter(lines), allow_dirty=True)

2) You need a comma in your header lines list:
             "--- orig/commands.py",

« Back to merge proposal