b.t.p.t.TestCaching(TestCaseWithBranch) : class documentation

Part of bzrlib.tests.per_branch.test_get_revision_id_to_revno_map View In Hierarchy

Tests for the caching of branches' dotted revno generation.

When locked, branches should avoid regenerating revision_id=>dotted revno mapping.

When not locked, obviously the revision_id => dotted revno will need to be regenerated or reread each time.

We test if revision_history is using the cache by instrumenting the branch's _gen_revno_map method, which is called by get_revision_id_to_revno_map.

Method get_instrumented_branch Get a branch and monkey patch it to log calls to _gen_revno_map.
Method test_unlocked Repeated calls will call _gen_revno_map each time.
Method test_locked Repeated calls will only call _gen_revno_map once.
Method test_set_revision_history_when_locked Calling set_revision_history should reset the cache.
Method test_set_last_revision_info_when_locked Calling set_last_revision_info should reset the cache.

Inherited from TestCaseWithBranch:

Method setUp Undocumented
Method get_branch Undocumented
Method get_default_format Undocumented
Method make_branch Undocumented
Method create_tree_with_merge Create a branch with a simple ancestry.
def get_instrumented_branch(self):
Get a branch and monkey patch it to log calls to _gen_revno_map.
Returnsa tuple of (the branch, list that calls will be logged to)
def test_unlocked(self):
Repeated calls will call _gen_revno_map each time.
def test_locked(self):
Repeated calls will only call _gen_revno_map once.
def test_set_revision_history_when_locked(self):
Calling set_revision_history should reset the cache.
def test_set_last_revision_info_when_locked(self):
Calling set_last_revision_info should reset the cache.
API Documentation for Bazaar, generated by pydoctor at 2022-06-16 00:25:16.