~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_workingtree.py

Merge Aarons integration branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
171
171
        self.assertEquals(list(tree.unknowns()),
172
172
                          ['hello.txt'])
173
173
 
 
174
    def test_hashcache(self):
 
175
        from bzrlib.tests.test_hashcache import pause
 
176
        b = Branch.initialize(u'.')
 
177
        tree = WorkingTree(u'.', b)
 
178
        self.build_tree(['hello.txt',
 
179
                         'hello.txt~'])
 
180
        tree.add('hello.txt')
 
181
        pause()
 
182
        sha = tree.get_file_sha1(tree.path2id('hello.txt'))
 
183
        self.assertEqual(1, tree._hashcache.miss_count)
 
184
        tree2 = WorkingTree(u'.', b)
 
185
        sha2 = tree2.get_file_sha1(tree2.path2id('hello.txt'))
 
186
        self.assertEqual(0, tree2._hashcache.miss_count)
 
187
        self.assertEqual(1, tree2._hashcache.hit_count)