workflow_tests: allow asserting webservice was not called (#87824)
gitea/wcs/pipeline/head This commit looks good
Details
gitea/wcs/pipeline/head This commit looks good
Details
This commit is contained in:
parent
0c0807a0d4
commit
3d42d456d9
|
@ -580,6 +580,14 @@ def test_workflow_tests_webservice(pub):
|
|||
testdef.run(formdef)
|
||||
assert str(excinfo.value) == 'Webservice response Fake response was used 0 times (instead of 1).'
|
||||
|
||||
testdef.workflow_tests.actions = [
|
||||
workflow_tests.AssertWebserviceCall(webservice_response_id=response.id, call_count=0),
|
||||
]
|
||||
|
||||
with pytest.raises(WorkflowTestError) as excinfo:
|
||||
testdef.run(formdef)
|
||||
assert str(excinfo.value) == 'Webservice response Fake response was used 1 times (instead of 0).'
|
||||
|
||||
testdef.workflow_tests.actions = [
|
||||
workflow_tests.AssertWebserviceCall(webservice_response_id='xxx', call_count=1),
|
||||
]
|
||||
|
|
|
@ -502,6 +502,8 @@ class AssertWebserviceCall(WorkflowTestAction):
|
|||
webservice_response_id = None
|
||||
call_count = 1
|
||||
|
||||
optional_fields = ['call_count']
|
||||
|
||||
XML_NODES = WorkflowTestAction.XML_NODES + [
|
||||
('webservice_response_id', 'str'),
|
||||
('call_count', 'int'),
|
||||
|
|
Loading…
Reference in New Issue