~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_transform.py

  • Committer: Aaron Bentley
  • Date: 2006-04-05 04:29:35 UTC
  • mto: (2027.1.2 revert-subpath-56549)
  • mto: This revision was merged to the branch mainline in revision 1647.
  • Revision ID: aaron.bentley@utoronto.ca-20060405042935-7a86762d00a3ae2e
Got all tests passing

Show diffs side-by-side

added added

removed removed

Lines of Context:
389
389
        conflicts.apply()
390
390
 
391
391
    def test_cook_conflicts(self):
 
392
        from bzrlib.conflicts import (DuplicateEntry, DuplicateID, 
 
393
                                      MissingParent, UnversionedParent,
 
394
                                      ParentLoop)
392
395
        tt, emerald, oz, old_dorothy, new_dorothy = self.get_conflicted()
393
396
        raw_conflicts = resolve_conflicts(tt)
394
397
        cooked_conflicts = cook_conflicts(raw_conflicts, tt)
395
 
        duplicate = ('duplicate', 'Moved existing file to', 'dorothy.moved', 
396
 
                     None, 'dorothy', 'dorothy-id')
 
398
        duplicate = DuplicateEntry('Moved existing file to', 'dorothy.moved', 
 
399
                                   'dorothy', None, 'dorothy-id')
397
400
        self.assertEqual(cooked_conflicts[0], duplicate)
398
 
        duplicate_id = ('duplicate id', 'Unversioned existing file', 
399
 
                        'dorothy.moved', None, 'dorothy', 'dorothy-id')
 
401
        duplicate_id = DuplicateID('Unversioned existing file', 
 
402
                                   'dorothy.moved', 'dorothy', None,
 
403
                                   'dorothy-id')
400
404
        self.assertEqual(cooked_conflicts[1], duplicate_id)
401
 
        missing_parent = ('missing parent', 'Not deleting', 'oz', 'oz-id')
 
405
        missing_parent = MissingParent('Not deleting', 'oz', 'oz-id')
402
406
        self.assertEqual(cooked_conflicts[2], missing_parent)
403
 
        unversioned_parent = ('unversioned parent', 
404
 
                              'Versioned directory', 'oz', 'oz-id')
 
407
        unversioned_parent = UnversionedParent('Versioned directory', 'oz',
 
408
                                               'oz-id')
405
409
        self.assertEqual(cooked_conflicts[3], unversioned_parent)
406
 
        parent_loop = ('parent loop', 'Cancelled move', 'oz/emeraldcity', 
407
 
                       'emerald-id', 'oz/emeraldcity', 'emerald-id')
 
410
        parent_loop = ParentLoop('Cancelled move', 'oz/emeraldcity', 
 
411
                                 'oz/emeraldcity', 'emerald-id', 'emerald-id')
408
412
        self.assertEqual(cooked_conflicts[4], parent_loop)
409
413
        self.assertEqual(len(cooked_conflicts), 5)
410
414
        tt.finalize()