Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

standardizing contract test names #556

Merged
merged 2 commits into from
Jul 6, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/rpdk/core/contract/suite/handler_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,22 +81,22 @@ def _create_with_invalid_model(resource_client):

@pytest.mark.create
@skip_not_writable_identifier
def contract_create_duplicate(created_resource, resource_client):
def contract_create_create(created_resource, resource_client):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gentle reminder- Update any reference to old names in documentation, if not done already.

_created_model, request = created_resource
test_create_failure_if_repeat_writeable_id(resource_client, request)


@pytest.mark.create
@pytest.mark.read
def contract_create_read_success(created_resource, resource_client):
def contract_create_read(created_resource, resource_client):
created_model, _request = created_resource
test_read_success(resource_client, created_model)


@pytest.mark.create
@pytest.mark.list
@pytest.mark.read
def contract_create_list_success(created_resource, resource_client):
def contract_create_list(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)
4 changes: 2 additions & 2 deletions src/rpdk/core/contract/suite/handler_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def updated_resource(resource_client):

@pytest.mark.update
@pytest.mark.read
def contract_update_read_success(updated_resource, resource_client):
def contract_update_read(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
Expand All @@ -57,7 +57,7 @@ def contract_update_read_success(updated_resource, resource_client):

@pytest.mark.update
@pytest.mark.list
def contract_update_list_success(updated_resource, resource_client):
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_resource
Expand Down
2 changes: 1 addition & 1 deletion src/rpdk/core/contract/suite/handler_update_invalid.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def contract_update_create_only_property(resource_client):
error_code=HandlerErrorCode.NotFound,
msg="cannot update a resource which does not exist",
)
def contract_update_non_existent_resource(resource_client):
def contract_update_without_create(resource_client):
create_request = resource_client.generate_invalid_create_example()
update_request = resource_client.generate_update_example(create_request)
_status, response, _error = resource_client.call_and_assert(
Expand Down