@@ -281,12 +281,20 @@ def has_only_writable_identifiers(self):
281281 )
282282
283283 def assert_write_only_property_does_not_exist (self , resource_model ):
284+
285+ error_list = []
284286 if self .write_only_paths :
285- assert not any (
286- self .key_error_safe_traverse (resource_model , write_only_property )
287- for write_only_property in self .write_only_paths
288- ), "The model MUST NOT return properties defined as \
289- writeOnlyProperties in the resource schema"
287+ for write_only_property in self .write_only_paths :
288+ val = self .key_error_safe_traverse (resource_model , write_only_property )
289+ if val :
290+ error_list .append (write_only_property [1 ])
291+ assertion_error_message = (
292+ "The model MUST NOT return properties defined as "
293+ "writeOnlyProperties in the resource schema "
294+ "\n Write only properties in resource model : %s \n Output Resource Model : %s \n "
295+ % (error_list , resource_model )
296+ )
297+ assert not any (error_list ), assertion_error_message
290298
291299 def get_metadata (self ):
292300 try :
@@ -450,7 +458,8 @@ def compare_model(self, inputs, outputs, path=()):
450458 "All properties specified in the request MUST "
451459 "be present in the model returned, and they MUST"
452460 " match exactly, with the exception of properties"
453- " defined as writeOnlyProperties in the resource schema"
461+ " defined as writeOnlyProperties in the resource schema \n Request Model : %s \n Returned Model : %s \n "
462+ % (inputs , outputs )
454463 )
455464 try :
456465 if isinstance (inputs , dict ):
@@ -476,6 +485,16 @@ def compare_model(self, inputs, outputs, path=()):
476485 new_path ,
477486 )
478487 else :
488+ if inputs [key ] != outputs [key ]:
489+ assertion_error_message = (
490+ "%s Value for property %s in Request Model(%s) and Response Model(%s) does not match"
491+ % (
492+ assertion_error_message ,
493+ key ,
494+ inputs [key ],
495+ outputs [key ],
496+ )
497+ )
479498 assert inputs [key ] == outputs [key ], assertion_error_message
480499 else :
481500 assert inputs == outputs , assertion_error_message
@@ -628,6 +647,22 @@ def is_primary_identifier_equal(
628647 match the primaryIdentifier passed into the request"
629648 ) from e
630649
650+ @staticmethod
651+ def get_primary_identifier (primary_identifier_path , model ):
652+ try :
653+ pid_list = []
654+ for primary_identifier in primary_identifier_path :
655+ data = traverse (model , fragment_list (primary_identifier , "properties" ))[
656+ 0
657+ ]
658+ pid_list .append (data )
659+ return pid_list
660+ except KeyError as e :
661+ raise AssertionError (
662+ "The primaryIdentifier returned in every progress event must\
663+ match the primaryIdentifier passed into the request \n "
664+ ) from e
665+
631666 def _make_payload (
632667 self ,
633668 action ,
0 commit comments