~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_chk_map.py

  • Committer: John Arbash Meinel
  • Date: 2010-02-04 16:06:36 UTC
  • mfrom: (5007 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5023.
  • Revision ID: john@arbash-meinel.com-20100204160636-xqeuwz8bwt8bbts4
Merge bzr.dev 5007, resolve conflict, update NEWS

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2008, 2009 Canonical Ltd
 
1
# Copyright (C) 2008, 2009, 2010 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
905
905
        # Unmapping the new node will check the existing nodes to see if they
906
906
        # would fit.
907
907
        # Clear the page cache so we ensure we have to read all the children
908
 
        chk_map._page_cache.clear()
 
908
        chk_map.clear_cache()
909
909
        chkmap.unmap(('aad',))
910
910
        self.assertIsInstance(chkmap._root_node._items['aaa'], LeafNode)
911
911
        self.assertIsInstance(chkmap._root_node._items['aab'], LeafNode)
945
945
        # Now clear the page cache, and only include 2 of the children in the
946
946
        # cache
947
947
        aab_key = chkmap._root_node._items['aab']
948
 
        aab_bytes = chk_map._page_cache[aab_key]
 
948
        aab_bytes = chk_map._get_cache()[aab_key]
949
949
        aac_key = chkmap._root_node._items['aac']
950
 
        aac_bytes = chk_map._page_cache[aac_key]
951
 
        chk_map._page_cache.clear()
952
 
        chk_map._page_cache[aab_key] = aab_bytes
953
 
        chk_map._page_cache[aac_key] = aac_bytes
 
950
        aac_bytes = chk_map._get_cache()[aac_key]
 
951
        chk_map.clear_cache()
 
952
        chk_map._get_cache()[aab_key] = aab_bytes
 
953
        chk_map._get_cache()[aac_key] = aac_bytes
954
954
 
955
955
        # Unmapping the new node will check the nodes from the page cache
956
956
        # first, and not have to read in 'aaa'