/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 breezy/tests/test_commit.py

  • Committer: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2019-06-15 17:53:40 UTC
  • mfrom: (7322.1.8 objects-1)
  • Revision ID: breezy.the.bot@gmail.com-20190615175340-yxo036zu96wh8lcz
Use the new attributes on TreeChange rather than indexing.

Merged from https://code.launchpad.net/~jelmer/brz/objects-1/+merge/368859

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
    BzrError,
39
39
    LockContention,
40
40
    )
 
41
from ..tree import TreeChange
41
42
from . import (
42
43
    TestCase,
43
44
    TestCaseWithTransport,
894
895
 
895
896
    def test_add_file_not_excluded(self):
896
897
        changes = [
897
 
            ('fid', (None, 'newpath'),
898
 
             0, (False, False), ('pid', 'pid'), ('newpath', 'newpath'),
899
 
             ('file', 'file'), (True, True))]
 
898
            TreeChange(
 
899
                'fid', (None, 'newpath'),
 
900
                0, (False, False), ('pid', 'pid'), ('newpath', 'newpath'),
 
901
                ('file', 'file'), (True, True))]
900
902
        self.assertEqual(changes, list(
901
903
            filter_excluded(changes, ['otherpath'])))
902
904
 
903
905
    def test_add_file_excluded(self):
904
906
        changes = [
905
 
            ('fid', (None, 'newpath'),
906
 
             0, (False, False), ('pid', 'pid'), ('newpath', 'newpath'),
907
 
             ('file', 'file'), (True, True))]
 
907
            TreeChange(
 
908
                'fid', (None, 'newpath'),
 
909
                0, (False, False), ('pid', 'pid'), ('newpath', 'newpath'),
 
910
                ('file', 'file'), (True, True))]
908
911
        self.assertEqual([], list(filter_excluded(changes, ['newpath'])))
909
912
 
910
913
    def test_delete_file_excluded(self):
911
914
        changes = [
912
 
            ('fid', ('somepath', None),
913
 
             0, (False, None), ('pid', None), ('newpath', None),
914
 
             ('file', None), (True, None))]
 
915
            TreeChange(
 
916
                'fid', ('somepath', None),
 
917
                0, (False, None), ('pid', None), ('newpath', None),
 
918
                ('file', None), (True, None))]
915
919
        self.assertEqual([], list(filter_excluded(changes, ['somepath'])))
916
920
 
917
921
    def test_move_from_or_to_excluded(self):
918
922
        changes = [
919
 
            ('fid', ('oldpath', 'newpath'),
920
 
             0, (False, False), ('pid', 'pid'), ('oldpath', 'newpath'),
921
 
             ('file', 'file'), (True, True))]
 
923
            TreeChange(
 
924
                'fid', ('oldpath', 'newpath'),
 
925
                0, (False, False), ('pid', 'pid'), ('oldpath', 'newpath'),
 
926
                ('file', 'file'), (True, True))]
922
927
        self.assertEqual([], list(filter_excluded(changes, ['oldpath'])))
923
928
        self.assertEqual([], list(filter_excluded(changes, ['newpath'])))