MCPcopy
hub / github.com/apache/caldera / setup_operations_api_test

Function setup_operations_api_test

tests/conftest.py:586–600  ·  view source on GitHub ↗
(event_loop, api_v2_client, test_operation, test_agent, test_ability,
                              active_link, finished_link, expected_link_output)

Source from the content-addressed store, hash-verified

584
585@pytest.fixture
586def setup_operations_api_test(event_loop, api_v2_client, test_operation, test_agent, test_ability,
587 active_link, finished_link, expected_link_output):
588 test_operation = OperationSchema().load(test_operation)
589 test_operation.agents.append(test_agent)
590 test_operation.set_start_details()
591 test_link = Link.load(active_link)
592 test_link.host = test_agent.host
593 finished_link = Link.load(finished_link)
594 finished_link.output = expected_link_output
595 finished_link.host = test_agent.host
596 test_operation.chain.append(test_link)
597 test_operation.chain.append(finished_link)
598 test_objective = Objective(id='123', name='test objective', description='test', goals=[])
599 test_operation.objective = test_objective
600 event_loop.run_until_complete(BaseService.get_service('data_svc').store(test_operation))
601
602
603@pytest.fixture

Callers

nothing calls this directly

Calls 6

OperationSchemaClass · 0.90
ObjectiveClass · 0.90
set_start_detailsMethod · 0.80
get_serviceMethod · 0.80
loadMethod · 0.45
storeMethod · 0.45

Tested by

no test coverage detected