~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_patches.py

  • Committer: John Arbash Meinel
  • Date: 2009-02-23 15:29:35 UTC
  • mfrom: (3943.7.7 bzr.code_style_cleanup)
  • mto: This revision was merged to the branch mainline in revision 4033.
  • Revision ID: john@arbash-meinel.com-20090223152935-oel9m92mwcc6nb4h
Merge the removal of all trailing whitespace, and resolve conflicts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
from bzrlib.tests import TestCase
22
22
 
23
23
from bzrlib.iterablefile import IterableFile
24
 
from bzrlib.patches import (MalformedLine, 
25
 
                            MalformedHunkHeader, 
26
 
                            MalformedPatchHeader, 
27
 
                            ContextLine, 
 
24
from bzrlib.patches import (MalformedLine,
 
25
                            MalformedHunkHeader,
 
26
                            MalformedPatchHeader,
 
27
                            ContextLine,
28
28
                            InsertLine,
29
 
                            RemoveLine, 
30
 
                            difference_index, 
 
29
                            RemoveLine,
 
30
                            difference_index,
31
31
                            get_patch_names,
32
 
                            hunk_from_header, 
33
 
                            iter_patched, 
 
32
                            hunk_from_header,
 
33
                            iter_patched,
34
34
                            iter_patched_from_hunks,
35
35
                            parse_line,
36
36
                            parse_patch,
40
40
class PatchesTester(TestCase):
41
41
 
42
42
    def datafile(self, filename):
43
 
        data_path = os.path.join(os.path.dirname(__file__), 
 
43
        data_path = os.path.join(os.path.dirname(__file__),
44
44
                                 "test_patches_data", filename)
45
45
        return file(data_path, "rb")
46
46
 
112
112
        self.lineThing(" hello\n", ContextLine)
113
113
        self.lineThing("+hello\n", InsertLine)
114
114
        self.lineThing("-hello\n", RemoveLine)
115
 
    
 
115
 
116
116
    def testMalformedLine(self):
117
117
        """Parse invalid valid hunk lines"""
118
118
        self.makeMalformedLine("hello\n")
119
 
    
 
119
 
120
120
    def compare_parsed(self, patchtext):
121
121
        lines = patchtext.splitlines(True)
122
122
        patch = parse_patch(lines.__iter__())