~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_inv.py

  • Committer: Robert Collins
  • Date: 2006-06-09 07:49:24 UTC
  • mfrom: (1753.1.4 add)
  • mto: (1725.2.9 commit)
  • mto: This revision was merged to the branch mainline in revision 1756.
  • Revision ID: robertc@robertcollins.net-20060609074924-82f9c095a195cbcc
(jam, robertc, ab)Merge new iter_entries_by_dirs routine which matches the order walkdirs provides.

Show diffs side-by-side

added added

removed removed

Lines of Context:
94
94
            ('src/hello.c', 'hello-id'),
95
95
            ], [(path, ie.file_id) for path, ie in inv.iter_entries()])
96
96
            
 
97
    def test_iter_entries_by_dir(self):
 
98
        inv = Inventory()
 
99
        
 
100
        for args in [('src', 'directory', 'src-id'), 
 
101
                     ('doc', 'directory', 'doc-id'), 
 
102
                     ('src/hello.c', 'file', 'hello-id'),
 
103
                     ('src/bye.c', 'file', 'bye-id'),
 
104
                     ('zz', 'file', 'zz-id'),
 
105
                     ('src/sub/', 'directory', 'sub-id'),
 
106
                     ('src/zz.c', 'file', 'zzc-id'),
 
107
                     ('src/sub/a', 'file', 'a-id'),
 
108
                     ('Makefile', 'file', 'makefile-id')]:
 
109
            inv.add_path(*args)
 
110
 
 
111
        self.assertEqual([
 
112
            ('Makefile', 'makefile-id'),
 
113
            ('doc', 'doc-id'),
 
114
            ('src', 'src-id'),
 
115
            ('zz', 'zz-id'),
 
116
            ('src/bye.c', 'bye-id'),
 
117
            ('src/hello.c', 'hello-id'),
 
118
            ('src/sub', 'sub-id'),
 
119
            ('src/zz.c', 'zzc-id'),
 
120
            ('src/sub/a', 'a-id'),
 
121
            ], [(path, ie.file_id) for path, ie in inv.iter_entries_by_dir()])
 
122
            
97
123
    def test_version(self):
98
124
        """Inventory remembers the text's version."""
99
125
        inv = Inventory()