MCPcopy Create free account
hub / github.com/Pometry/Raphtory / test_mutations

Function test_mutations

python/tests/test_auth.py:224–244  ·  view source on GitHub ↗
(query)

Source from the content-addressed store, hash-verified

222 "query", [NEW_GRAPH, MOVE_GRAPH, COPY_GRAPH, DELETE_GRAPH, CREATE_SUBGRAPH]
223)
224def test_mutations(query):
225 work_dir = tempfile.mkdtemp()
226 with GraphServer(
227 work_dir, config={"auth": {"public_key": PUB_KEY}}
228 ).start() as server:
229 port = server.port()
230 add_test_graph(port)
231 data = json.dumps({"query": query})
232
233 response = requests.post(raphtory_url(port), data=data)
234 assert response.status_code == 401
235
236 response = requests.post(raphtory_url(port), headers=READ_HEADERS, data=data)
237 assert response.json()["data"] is None
238 assert (
239 response.json()["errors"][0]["message"]
240 == "The requested endpoint requires write access"
241 )
242
243 response = requests.post(raphtory_url(port), headers=WRITE_HEADERS, data=data)
244 assert_successful_response(response)
245
246
247def test_raphtory_client():

Callers

nothing calls this directly

Calls 6

GraphServerClass · 0.90
add_test_graphFunction · 0.85
raphtory_urlFunction · 0.85
startMethod · 0.45
portMethod · 0.45

Tested by

no test coverage detected