def test_cache_init_creates_store_and_stats(self, CacheStats): store = MagicMock() c = Cache(store=store, ttl=100, tti=10, foo=1, bar=2, baz=3) CacheStats.assert_called_once_with() store.assert_called_once_with(foo=1, bar=2, baz=3) self.assertEqual(c.store, store.return_value) self.assertEqual(c.stats, CacheStats.return_value)