/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: Robert Collins
  • Date: 2005-09-26 08:56:15 UTC
  • mto: (1092.3.4)
  • mto: This revision was merged to the branch mainline in revision 1390.
  • Revision ID: robertc@robertcollins.net-20050926085615-99b8fb35f41b541d
massive patch from Alexander Belchenko - many PEP8 fixes, removes unused function uuid

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
16
 
17
 
from bzrlib.selftest import InTempDir
 
17
import os
 
18
import time
 
19
from bzrlib.selftest import TestCaseInTempDir
18
20
 
19
21
 
20
22
 
24
26
 
25
27
 
26
28
def pause():
27
 
    import time
 
29
    if os.name == 'nt':
 
30
        time.sleep(3)
 
31
        return
28
32
    # allow it to stabilize
29
33
    start = int(time.time())
30
34
    while int(time.time()) == start:
31
35
        time.sleep(0.2)
32
36
    
33
37
 
 
38
class TestHashCache(TestCaseInTempDir):
34
39
 
35
 
class TestHashCache(InTempDir):
36
 
    """Functional tests for hashcache"""
37
 
    def runTest(self):
 
40
    def test_hashcache(self):
 
41
        """Functional tests for hashcache"""
38
42
        from bzrlib.hashcache import HashCache
39
43
        import os
40
 
        import time
41
44
 
42
45
        # make a dummy bzr directory just to hold the cache
43
46
        os.mkdir('.bzr')
112
115
        self.assertEquals(hc.hit_count, 1)
113
116
        self.assertEquals(hc.miss_count, 0)
114
117
        self.assertEquals(hc.get_sha1('foo2'), sha1('new content'))
115
 
 
116
 
        
117
 
 
118
 
        
119