~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_graph.py

  • Committer: Aaron Bentley
  • Date: 2008-12-03 05:09:44 UTC
  • mto: This revision was merged to the branch mainline in revision 3892.
  • Revision ID: aaron@aaronbentley.com-20081203050944-biuf61wbttr0wrzv
Allow miss caching to be disabled.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1446
1446
        self.caching_pp.disable_cache()
1447
1447
        self.assertIs(None, self.caching_pp.get_cached_map())
1448
1448
 
 
1449
    def test_cache_misses(self):
 
1450
        self.assertEqual({}, self.caching_pp.get_cached_map())
 
1451
        self.caching_pp.get_parent_map(['rev3'])
 
1452
        self.caching_pp.get_parent_map(['rev3'])
 
1453
        self.assertEqual(['rev3'], self.inst_pp.calls)
 
1454
 
 
1455
    def test_no_cache_misses(self):
 
1456
        self.caching_pp.enable_cache(cache_misses=False)
 
1457
        self.caching_pp.get_parent_map(['rev3'])
 
1458
        self.caching_pp.get_parent_map(['rev3'])
 
1459
        self.assertEqual(['rev3', 'rev3'], self.inst_pp.calls)
 
1460
 
1449
1461
    def test_cache_extras(self):
1450
1462
        self.assertEqual({}, self.caching_pp.get_parent_map(['rev3']))
1451
1463
        self.assertEqual({'rev2': ['rev1']},