2
2
3
3
from rpdk .core .contract .interface import Action , HandlerErrorCode , OperationStatus
4
4
from rpdk .core .contract .resource_client import (
5
- create_model_with_properties_in_path ,
6
5
prune_properties_from_model ,
7
6
prune_properties_if_not_exist_in_path ,
8
7
)
@@ -50,12 +49,8 @@ def test_create_failure_if_repeat_writeable_id(resource_client, current_resource
50
49
@response_does_not_contain_write_only_properties
51
50
@response_contains_resource_model_equal_current_model
52
51
def test_read_success (resource_client , current_resource_model ):
53
- primay_identifier_only_model = create_model_with_properties_in_path (
54
- current_resource_model .copy (),
55
- resource_client .primary_identifier_paths ,
56
- )
57
52
_status , response , _error_code = resource_client .call_and_assert (
58
- Action .READ , OperationStatus .SUCCESS , primay_identifier_only_model
53
+ Action .READ , OperationStatus .SUCCESS , current_resource_model
59
54
)
60
55
return response
61
56
@@ -69,12 +64,8 @@ def test_read_failure_not_found(
69
64
resource_client ,
70
65
current_resource_model ,
71
66
):
72
- primay_identifier_only_model = create_model_with_properties_in_path (
73
- current_resource_model ,
74
- resource_client .primary_identifier_paths ,
75
- )
76
67
_status , _response , error_code = resource_client .call_and_assert (
77
- Action .READ , OperationStatus .FAILED , primay_identifier_only_model
68
+ Action .READ , OperationStatus .FAILED , current_resource_model
78
69
)
79
70
return error_code
80
71
@@ -137,12 +128,8 @@ def test_update_failure_not_found(resource_client, current_resource_model):
137
128
138
129
139
130
def test_delete_success (resource_client , current_resource_model ):
140
- primay_identifier_only_model = create_model_with_properties_in_path (
141
- current_resource_model ,
142
- resource_client .primary_identifier_paths ,
143
- )
144
131
_status , response , _error_code = resource_client .call_and_assert (
145
- Action .DELETE , OperationStatus .SUCCESS , primay_identifier_only_model
132
+ Action .DELETE , OperationStatus .SUCCESS , current_resource_model
146
133
)
147
134
return response
148
135
@@ -153,12 +140,8 @@ def test_delete_success(resource_client, current_resource_model):
153
140
if the resource did not exist prior to the delete request" ,
154
141
)
155
142
def test_delete_failure_not_found (resource_client , current_resource_model ):
156
- primay_identifier_only_model = create_model_with_properties_in_path (
157
- current_resource_model ,
158
- resource_client .primary_identifier_paths ,
159
- )
160
143
_status , _response , error_code = resource_client .call_and_assert (
161
- Action .DELETE , OperationStatus .FAILED , primay_identifier_only_model
144
+ Action .DELETE , OperationStatus .FAILED , current_resource_model
162
145
)
163
146
return error_code
164
147
0 commit comments