def contract_delete_list(resource_client, deleted_resource): # LIST: Should not fail after deletion, since it is a list of all # current resources of the resource type. Deletion should # remove the model from the list, however. deleted_model, _request = deleted_resource assert not test_model_in_list(resource_client, deleted_model)
def contract_update_list_success(updated_resource, resource_client): # should be able to use the created model # to read since physical resource id is immutable _create_request, _created_model, _update_request, updated_model = updated_resource assert resource_client.is_primary_identifier_equal( resource_client.primary_identifier_paths, _created_model, updated_model ) assert test_model_in_list(resource_client, updated_model)
def contract_update_list(updated_resource, resource_client): # should be able to use the created model # to read since physical resource id is immutable ( _create_request, _created_model, _update_request, updated_model, _updated_input_model, ) = updated_resource assert resource_client.is_primary_identifier_equal( resource_client.primary_identifier_paths, _created_model, updated_model), "The primaryIdentifier returned must match\ the primaryIdentifier passed into the request" assert test_model_in_list( resource_client, updated_model), "A list handler MUST always return an updated model"
def contract_create_list_success(created_resource, resource_client): created_model, _request = created_resource assert test_model_in_list(resource_client, created_model) test_read_success(resource_client, created_model)