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())
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())
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"])
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"])