/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 bzrlib/selftest/testhashcache.py

  • Committer: Martin Pool
  • Date: 2005-07-08 02:28:58 UTC
  • Revision ID: mbp@sourcefrog.net-20050708022858-f8323aaea09ea4f2
- more hash-cache tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
69
69
                          '3c8ec4874488f6090a157b014ce3397ca8e06d4f')
70
70
        self.assertEquals(hc.miss_count, 2)
71
71
 
72
 
        hc.write('stat-cache')
73
 
 
74
72
        # quickly write new file of same size and make sure it is seen
75
73
        # this may rely on detection of timestamps that are too close
76
74
        # together to be safe
81
79
        # this is not quite guaranteed to be true; we might have
82
80
        # crossed a 1s boundary before
83
81
        self.assertEquals(hc.danger_count, 1)
 
82
        self.assertEquals(len(hc._cache), 0)
84
83
 
85
84
        self.assertEquals(hc.get_sha1('subdir'), None)
86
85
 
87
 
        
 
86
        pause()
 
87
 
 
88
        # should now be safe to cache it
 
89
        self.assertEquals(hc.get_sha1('foo'),
 
90
                          sha1('g00dbye'))
 
91
        self.assertEquals(len(hc._cache), 1)
 
92
 
 
93
        # write out, read back in and check that we don't need to
 
94
        # re-read any files
 
95
        hc.write('stat-cache')
 
96
        del hc
 
97
 
 
98
        hc = HashCache('.')
 
99
        # hc.read('stat-cache')
 
100
        
 
101
 
 
102
        
 
103