Skip to content

Commit

Permalink
Use deep copy for model compare (#766)
Browse files Browse the repository at this point in the history
* Use deep copy for model compare

* Fix isort
  • Loading branch information
Wenbing Li authored May 20, 2021
1 parent 11618fa commit 7dbaa25
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/rpdk/core/contract/suite/handler_commons.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import copy
import logging

from rpdk.core.contract.interface import Action, HandlerErrorCode, OperationStatus
Expand Down Expand Up @@ -149,15 +150,15 @@ def test_delete_failure_not_found(resource_client, current_resource_model):

def test_input_equals_output(resource_client, input_model, output_model):
pruned_input_model = prune_properties_from_model(
input_model.copy(),
copy.deepcopy(input_model),
set(
list(resource_client.read_only_paths)
+ list(resource_client.write_only_paths)
),
)

pruned_output_model = prune_properties_from_model(
output_model.copy(), resource_client.read_only_paths
copy.deepcopy(output_model), resource_client.read_only_paths
)

pruned_output_model = prune_properties_if_not_exist_in_path(
Expand Down

0 comments on commit 7dbaa25

Please sign in to comment.