MCPcopy Index your code
hub / github.com/apache/caldera / test_remove_fact

Function test_remove_fact

tests/api/v2/test_knowledge.py:167–185  ·  view source on GitHub ↗
(knowledge_webapp, aiohttp_client, fire_event_mock)

Source from the content-addressed store, hash-verified

165
166
167async def test_remove_fact(knowledge_webapp, aiohttp_client, fire_event_mock):
168 client = await aiohttp_client(knowledge_webapp)
169 fact_data = {
170 'trait': 'demo',
171 'value': 'test'
172 }
173 init = await client.post('/facts', json=fact_data, headers=headers)
174 pre = await init.json()
175 subs = await client.delete('/facts', json=fact_data, headers=headers)
176 post = await subs.json()
177 tmp = await client.get('/facts', json=fact_data, headers=headers)
178 cur = await tmp.json()
179 current = cur['found']
180 start = pre['added']
181 end = post['removed']
182 assert len(start) == 1
183 assert len(end) == 1
184 assert len(current) == 0
185 assert start == end
186
187
188async def test_remove_relationship(knowledge_webapp, aiohttp_client, fire_event_mock):

Callers

nothing calls this directly

Calls 1

aiohttp_clientFunction · 0.85

Tested by

no test coverage detected