~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/testhashcache.py

  • Committer: Martin Pool
  • Date: 2005-07-08 06:54:58 UTC
  • Revision ID: mbp@sourcefrog.net-20050708065458-2af06c3659faf1d8
- use new path-based hashcache for WorkingTree- squash mtime/ctime to whole seconds- update and if necessary write out hashcache when WorkingTree object is   created.

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
        import os
40
40
        import time
41
41
 
 
42
        # make a dummy bzr directory just to hold the cache
 
43
        os.mkdir('.bzr')
42
44
        hc = HashCache('.')
43
45
 
44
46
        file('foo', 'wb').write('hello')
99
101
 
100
102
        # write out, read back in and check that we don't need to
101
103
        # re-read any files
102
 
        hc.write('stat-cache')
 
104
        hc.write()
103
105
        del hc
104
106
 
105
107
        hc = HashCache('.')
106
 
        hc.read('stat-cache')
 
108
        hc.read()
107
109
 
108
110
        self.assertEquals(len(hc._cache), 2)
109
111
        self.assertEquals(hc.get_sha1('foo'), sha1('g00dbye'))