/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_transform.py

  • Committer: Vincent Ladeuil
  • Date: 2010-09-16 16:43:05 UTC
  • mto: (5502.1.1 trunk)
  • mto: This revision was merged to the branch mainline in revision 5504.
  • Revision ID: v.ladeuil+lp@free.fr-20100916164305-vartuzc0yalkw4fn
Ensures we fallback to the default policy if a bogus one is specified.

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
    rules,
30
30
    symbol_versioning,
31
31
    tests,
 
32
    trace,
32
33
    transform,
33
34
    urlutils,
34
35
    )
3314
3315
        self.assertLength(1, remaining_conflicts)
3315
3316
        self.assertEqual(('deleting parent', 'Not deleting', 'new-1'),
3316
3317
                         remaining_conflicts.pop())
 
3318
 
 
3319
    def test_unknown_orphan_policy(self):
 
3320
        wt = self.make_branch_and_tree('.')
 
3321
        # Set a fictional policy nobody ever implemented
 
3322
        self._set_orphan_policy(wt, 'donttouchmypreciouuus')
 
3323
        tt, orphan_tid = self._prepare_orphan(wt)
 
3324
        warnings = []
 
3325
        def warning(*args):
 
3326
            warnings.append(args[0] % args[1:])
 
3327
        self.overrideAttr(trace, 'warning', warning)
 
3328
        remaining_conflicts = resolve_conflicts(tt)
 
3329
        # We fallback to the default policy which resolve the conflict by
 
3330
        # creating an orphan
 
3331
        self.assertLength(0, remaining_conflicts)
 
3332
        self.assertLength(2, warnings)
 
3333
        self.assertStartsWith( warnings[0], 'donttouchmypreciouuus')
 
3334
        self.assertStartsWith(warnings[1], 'dir/foo has been orphaned')