CountDatastoreCalls now mocks functions of the ExtendedDatabase, which means cache calls are now also checked.
This partially defeats the purpose of the method. The mocker also only looks at some functions. It could be mediated by mocking functions of the DatabaseReader (and maybe -Writer) instead, but I am not sure how far that should go...
Do we want to measure calls to database adapter functions, or are we interested in actual database calls? If it's the latter, it would be necessary to mock the reader/writer functions instead. Maybe taking into account what to do with methods that have the retry_on_db_failure decorator.
CountDatastoreCallsnow mocks functions of theExtendedDatabase, which means cache calls are now also checked.This partially defeats the purpose of the method. The mocker also only looks at some functions. It could be mediated by mocking functions of the
DatabaseReader(and maybe-Writer) instead, but I am not sure how far that should go...Do we want to measure calls to database adapter functions, or are we interested in actual database calls? If it's the latter, it would be necessary to mock the reader/writer functions instead. Maybe taking into account what to do with methods that have the retry_on_db_failure decorator.