MCPcopy Create free account
hub / github.com/cosdata/cosdata / lookup

Function lookup

tests/test-key-value-store.py:80–86  ·  view source on GitHub ↗
(name, key)

Source from the content-addressed store, hash-verified

78 raise Exception(f"Failed to bulk upsert: {response.text}")
79
80def lookup(name, key):
81 url = f"{client.base_url}/collections/{name}/search/key-value"
82 data = {"key": key}
83 response = requests.post(url, headers=client._get_headers(), data=json.dumps(data), verify=client.verify_ssl)
84 if response.status_code != 200:
85 raise Exception(f"Failed to search: {response.text}")
86 return bytes(response.json()["bytes"]).decode("utf-8")
87
88def delete_collection(name):
89 url = f"{client.base_url}/collections/{name}"

Callers 11

test_basic_upsert_lookupFunction · 0.70
test_unicode_contentFunction · 0.70
test_special_charactersFunction · 0.70
test_large_valueFunction · 0.70
test_json_valueFunction · 0.70
test_bulk_upsertFunction · 0.70
test_key_not_foundFunction · 0.70
test_transaction_abortFunction · 0.70
test_binary_like_contentFunction · 0.70
test_key_variationsFunction · 0.70

Calls 1

_get_headersMethod · 0.45

Tested by

no test coverage detected