Skip to content

Commit ad084f8

Browse files
authored
removing contract_update_create_only_property (#721)
1 parent e569026 commit ad084f8

File tree

1 file changed

+0
-35
lines changed

1 file changed

+0
-35
lines changed

src/rpdk/core/contract/suite/handler_update_invalid.py

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -9,41 +9,6 @@
99
from rpdk.core.contract.suite.contract_asserts import failed_event
1010

1111

12-
@pytest.mark.update
13-
@failed_event(
14-
error_code=(HandlerErrorCode.NotUpdatable, HandlerErrorCode.NotFound),
15-
msg="An update hander MUST return FAILED with a NotUpdatable error code \
16-
if the difference between the previous state and the properties included \
17-
in the request contains a property defined in the createOnlyProperties \
18-
in the resource schema",
19-
)
20-
def contract_update_create_only_property(resource_client):
21-
22-
if resource_client.create_only_paths:
23-
create_request = resource_client.generate_create_example()
24-
try:
25-
_status, response, _error = resource_client.call_and_assert(
26-
Action.CREATE, OperationStatus.SUCCESS, create_request
27-
)
28-
created_model = response["resourceModel"]
29-
update_request = resource_client.generate_invalid_update_example(
30-
created_model
31-
)
32-
_status, response, _error_code = resource_client.call_and_assert(
33-
Action.UPDATE, OperationStatus.FAILED, update_request, created_model
34-
)
35-
assert response[
36-
"message"
37-
], "The progress event MUST return an error message\
38-
when the status is failed"
39-
finally:
40-
resource_client.call_and_assert(
41-
Action.DELETE, OperationStatus.SUCCESS, created_model
42-
)
43-
else:
44-
pytest.skip("No createOnly Properties. Skipping test.")
45-
46-
4712
@pytest.mark.update
4813
@failed_event(
4914
error_code=HandlerErrorCode.NotFound,

0 commit comments

Comments
 (0)