forked from ScoDoc/ScoDoc
API tests: fix verify_fields qui testait à l'envers
This commit is contained in:
parent
8486512f83
commit
be51032b8a
@ -2,16 +2,13 @@
|
||||
"""
|
||||
|
||||
|
||||
def verify_fields(json_response: dict, fields: set) -> bool:
|
||||
def verify_fields(json_response: dict, expected_fields: set) -> bool:
|
||||
"""
|
||||
Vérifie si les champs attendu de la réponse json sont présents
|
||||
|
||||
json_response : la réponse de la requête
|
||||
fields : ensemble des champs à vérifier
|
||||
expected_fields : ensemble des champs à vérifier
|
||||
|
||||
Retourne True ou False
|
||||
"""
|
||||
for field in json_response:
|
||||
if field not in fields:
|
||||
return False
|
||||
return True
|
||||
return all(field in json_response for field in expected_fields)
|
||||
|
Loading…
Reference in New Issue
Block a user