~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_patches.py

  • Committer: Aaron Bentley
  • Date: 2009-11-03 15:45:56 UTC
  • mto: (4634.97.2 2.0)
  • mto: This revision was merged to the branch mainline in revision 4798.
  • Revision ID: aaron@aaronbentley.com-20091103154556-e953dmegqbinyokq
Improve patch binary section handling.

Show diffs side-by-side

added added

removed removed

Lines of Context:
156
156
        self.assertContainsRe(str(patches[0]),
157
157
                                  'Binary files bar\t.* and qux\t.* differ\n')
158
158
 
 
159
    def test_parse_binary_after_normal(self):
 
160
        patches = parse_patches(self.data_lines("binary-after-normal.patch"))
 
161
        self.assertIs(BinaryPatch, patches[1].__class__)
 
162
        self.assertIs(Patch, patches[0].__class__)
 
163
        self.assertContainsRe(patches[1].oldname, '^bar\t')
 
164
        self.assertContainsRe(patches[1].newname, '^qux\t')
 
165
        self.assertContainsRe(str(patches[1]),
 
166
                                  'Binary files bar\t.* and qux\t.* differ\n')
 
167
 
159
168
    def test_roundtrip_binary(self):
160
169
        patchtext = ''.join(self.data_lines("binary.patch"))
161
170
        patches = parse_patches(patchtext.splitlines(True))