~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_merge_directive.py

  • Committer: Robert Collins
  • Date: 2007-06-26 08:52:20 UTC
  • mto: This revision was merged to the branch mainline in revision 2554.
  • Revision ID: robertc@robertcollins.net-20070626085220-iovhwfjflk8vffbh
Add require_api API.

Show diffs side-by-side

added added

removed removed

Lines of Context:
202
202
        tree_a.commit('Commit of rev2a', rev_id='rev2a')
203
203
        return tree_a, tree_b, branch_c
204
204
 
 
205
    def test_empty_target(self):
 
206
        tree_a, tree_b, branch_c = self.make_trees()
 
207
        tree_d = self.make_branch_and_tree('tree_d')
 
208
        md2 = merge_directive.MergeDirective.from_objects(
 
209
            tree_a.branch.repository, 'rev2a', 500, 120, tree_d.branch.base,
 
210
            patch_type='diff', public_branch=tree_a.branch.base)
 
211
 
205
212
    def test_generate_patch(self):
206
213
        tree_a, tree_b, branch_c = self.make_trees()
207
214
        md2 = merge_directive.MergeDirective.from_objects(
265
272
        self.assertContainsRe(md1.patch, '\\+content_c')
266
273
        self.assertNotContainsRe(md1.patch, '\\+content_a')
267
274
 
 
275
    def test_broken_bundle(self):
 
276
        tree_a, tree_b, branch_c = self.make_trees()
 
277
        md1 = merge_directive.MergeDirective.from_objects(
 
278
            tree_a.branch.repository, 'rev2a', 500, 120, tree_b.branch.base,
 
279
            public_branch=branch_c.base)
 
280
        lines = md1.to_lines()
 
281
        lines = [l.replace('\n', '\r\n') for l in lines]
 
282
        md2 = merge_directive.MergeDirective.from_lines(lines)
 
283
        self.assertEqual('rev2a', md2.revision_id)
 
284
 
268
285
    def test_signing(self):
269
286
        time = 453
270
287
        timezone = 7200