Exemplo n.º 1
0
    def test_keys_invalid_status(self):
        pool = mock.Mock(spec=riakcached.pools.Pool)
        pool.request.return_value = 204, "", {}
        pool.url = "http://127.0.0.1:8098"

        client = RiakClient("test_bucket", pool=pool)
        self.assertIsNone(client.keys())
Exemplo n.º 2
0
    def test_keys_invalid_status(self):
        pool = mock.Mock(spec=riakcached.pools.Pool)
        pool.request.return_value = 204, "", {}
        pool.url = "http://127.0.0.1:8098"

        client = RiakClient("test_bucket", pool=pool)
        self.assertIsNone(client.keys())
Exemplo n.º 3
0
    def test_keys_valid_status(self):
        pool = mock.Mock(spec=riakcached.pools.Pool)
        pool.request.return_value = 200, '["key1", "key2"]', {}
        pool.url = "http://127.0.0.1:8098"

        client = RiakClient("test_bucket", pool=pool)
        self.assertEqual(client.keys(), ["key1", "key2"])
Exemplo n.º 4
0
    def test_keys_valid_status(self):
        pool = mock.Mock(spec=riakcached.pools.Pool)
        pool.request.return_value = 200, '["key1", "key2"]', {}
        pool.url = "http://127.0.0.1:8098"

        client = RiakClient("test_bucket", pool=pool)
        self.assertEqual(client.keys(), ["key1", "key2"])