Пример #1
0
    def test_exists_for_invalid_key(self):
        client = mock.Mock()
        client.get.return_value = None

        store = MemcacheBackingStore(60, client)
        self.assertFalse(store.exists("get_templates"))

        client.get.assert_called_once_with("get_templates")
Пример #2
0
    def test_exists(self):
        client = mock.Mock()
        client.get.return_value = (10, "value")

        store = MemcacheBackingStore(60, client)
        self.assertTrue(store.exists("get_templates"))

        client.get.assert_called_once_with("get_templates")