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
Traceback (most recent call last): File "/home/mbp/lib/python/testtools/runtest.py", line 128, in _run_user return fn(*args) File "/home/mbp/lib/python/testtools/testcase.py", line 369, in _run_test_method testMethod() File "/home/mbp/bzr/502076-dirty-patches/bzrlib/tests/test_patches.py", line 63, in test_parse_leading_noise bits = parse_patch(iter(lines), allow_dirty=True) File "/home/mbp/bzr/502076-dirty-patches/bzrlib/patches.py", line 364, in parse_patch (orig_name, mod_name) = get_patch_names(iter_lines) File "/home/mbp/bzr/502076-dirty-patches/bzrlib/patches.py", line 76, in get_patch_names raise MalformedPatchHeader("No orig name", line) MalformedPatchHeader: Malformed patch header. No orig name 'diff -pruN commands.py'
Can someone tell me what format this is supposed to be parsing, or what's wrong with that test?
« Back to merge proposal
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) : /bugs.edge. launchpad. net/bzr/ +bug/502076 iter(lines) , allow_dirty=True)
"""Parse a valid patch header"""
# https:/
lines = ["diff -pruN commands.py",
"--- orig/commands.py"
"+++ mod/dommands.py"]
bits = parse_patch(
however this fails with
Traceback (most recent call last): mbp/lib/ python/ testtools/ runtest. py", line 128, in _run_user mbp/lib/ python/ testtools/ testcase. py", line 369, in _run_test_method mbp/bzr/ 502076- dirty-patches/ bzrlib/ tests/test_ patches. py", line 63, in test_parse_ leading_ noise iter(lines) , allow_dirty=True) mbp/bzr/ 502076- dirty-patches/ bzrlib/ patches. py", line 364, in parse_patch names(iter_ lines) mbp/bzr/ 502076- dirty-patches/ bzrlib/ patches. py", line 76, in get_patch_names eader(" No orig name", line) eader: Malformed patch header. No orig name
File "/home/
return fn(*args)
File "/home/
testMethod()
File "/home/
bits = parse_patch(
File "/home/
(orig_name, mod_name) = get_patch_
File "/home/
raise MalformedPatchH
MalformedPatchH
'diff -pruN commands.py'
Can someone tell me what format this is supposed to be parsing, or what's wrong with that test?