@@ -39,9 +39,7 @@ def check_query_all_resource_types(context: CheckContext) -> CheckResult:
3939 )
4040 available = ", " .join ([f"'{ resource .name } '" for resource in response .resources ])
4141 reason = f"Resource types available are: { available } "
42- return CheckResult (
43- context .conf , status = Status .SUCCESS , reason = reason , data = response .resources
44- )
42+ return CheckResult (status = Status .SUCCESS , reason = reason , data = response .resources )
4543
4644
4745@checker ("discovery" , "resource-types" )
@@ -54,14 +52,10 @@ def check_query_resource_type_by_id(
5452 expected_status_codes = context .conf .expected_status_codes or [200 ],
5553 )
5654 if isinstance (response , Error ):
57- return CheckResult (
58- context .conf , status = Status .ERROR , reason = response .detail , data = response
59- )
55+ return CheckResult (status = Status .ERROR , reason = response .detail , data = response )
6056
6157 reason = f"Successfully accessed the /ResourceTypes/{ resource_type .id } endpoint."
62- return CheckResult (
63- context .conf , status = Status .SUCCESS , reason = reason , data = response
64- )
58+ return CheckResult (status = Status .SUCCESS , reason = reason , data = response )
6559
6660
6761@checker ("discovery" , "resource-types" )
@@ -76,22 +70,19 @@ def check_access_invalid_resource_type(context: CheckContext) -> CheckResult:
7670
7771 if not isinstance (response , Error ):
7872 return CheckResult (
79- context .conf ,
8073 status = Status .ERROR ,
8174 reason = f"/resource_types/{ probably_invalid_id } invalid URL did not return an Error object" ,
8275 data = response ,
8376 )
8477
8578 if response .status != 404 :
8679 return CheckResult (
87- context .conf ,
8880 status = Status .ERROR ,
8981 reason = f"/resource_types/{ probably_invalid_id } invalid URL did return an object, but the status code is { response .status } " ,
9082 data = response ,
9183 )
9284
9385 return CheckResult (
94- context .conf ,
9586 status = Status .SUCCESS ,
9687 reason = f"/resource_types/{ probably_invalid_id } invalid URL correctly returned a 404 error" ,
9788 data = response ,
0 commit comments