(knowledge_webapp, aiohttp_client, fire_event_mock)
| 218 | |
| 219 | |
| 220 | async def test_add_fact(knowledge_webapp, aiohttp_client, fire_event_mock): |
| 221 | client = await aiohttp_client(knowledge_webapp) |
| 222 | |
| 223 | fact_data = { |
| 224 | 'trait': 'demo', |
| 225 | 'value': 'test' |
| 226 | } |
| 227 | resp = await client.post('/facts', json=fact_data, headers=headers) |
| 228 | data = await resp.json() |
| 229 | response = data['added'] |
| 230 | assert len(response) == 1 |
| 231 | assert response[0]['trait'] == 'demo' |
| 232 | assert response[0]['value'] == 'test' |
| 233 | |
| 234 | tmp = await client.get('/facts', json=fact_data, headers=headers) |
| 235 | cur = await tmp.json() |
| 236 | current = cur['found'] |
| 237 | assert current == response |
| 238 | |
| 239 | |
| 240 | async def test_add_fact_to_operation(knowledge_webapp, aiohttp_client, test_operation, setup_empty_operation, fire_event_mock): |
nothing calls this directly
no test coverage detected