Пример #1
0
 def test_cache_exc_handling(self):
     mock_client = mock.Mock()
     mock_client.set.side_effect = Exception("message")
     store = RedisBackingStore(60, mock_client)
     store.cache("get_templates", "content")
Пример #2
0
    def test_cache(self):
        mock_client = mock.Mock()
        store = RedisBackingStore(60, mock_client)
        store.cache("get_templates", "content")

        mock_client.set.assert_called_once_with("get_templates", "\x80\x02U\x07contentq\x01.")