toulouse-maelis: [tests] count soap requests (#88873)
gitea/passerelle/pipeline/head This commit looks good Details

This commit is contained in:
Nicolas Roche 2024-04-03 16:58:57 +02:00 committed by Benjamin Dauvergne
parent 10590eb9d9
commit d4bb8059e0
2 changed files with 5 additions and 2 deletions

View File

@ -1726,18 +1726,21 @@ def test_search_family(family_service, con, app):
def test_search_family_dui(family_service, con, app):
family_service.add_soap_response('readFamilyList', get_xml_file('R_read_family_list.xml'))
soap_mock = family_service.add_soap_response('readFamilyList', get_xml_file('R_read_family_list.xml'))
url = get_endpoint('search-family-dui')
resp = app.get(url + '?q=1312')
assert soap_mock.call_count == 1
assert resp.json['err'] == 0
assert len(resp.json['data']) == 1
resp = app.get(url + '?q=')
assert soap_mock.call_count == 1
assert resp.json['err'] == 0
assert resp.json['data'] == []
resp = app.get(url + '?q=abcd')
assert soap_mock.call_count == 1
assert resp.json['err'] == 0
assert resp.json['data'] == []

View File

@ -126,7 +126,7 @@ class ResponsesSoap:
body = response_content
else:
body = response_content
self.requests_mock.add(
return self.requests_mock.add(
responses.POST,
self.address,
body=body,