Skip to content

Commit

Permalink
fix: lint fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Omar Al Bastami <omar.albastami@ibm.com>
  • Loading branch information
Omar Al Bastami authored and omar-albastami committed Sep 4, 2024
1 parent 2654fb0 commit 7090a14
Showing 1 changed file with 24 additions and 7 deletions.
31 changes: 24 additions & 7 deletions test/unit/test_cd_toolchain_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,10 @@ def test_create_toolchain_event_value_error(self):
"content_type": content_type,
}
for param in req_param_dict.keys():
req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()}
req_copy = {
key: val if key is not param else None
for (key, val) in req_param_dict.items()
}
with pytest.raises(ValueError):
_service.create_toolchain_event(**req_copy)

Expand Down Expand Up @@ -1828,12 +1831,18 @@ def test_toolchain_event_post_serialization(self):
toolchain_event_post_model_json["id"] = "testString"

# Construct a model instance of ToolchainEventPost by calling from_dict on the json representation
toolchain_event_post_model = ToolchainEventPost.from_dict(toolchain_event_post_model_json)
toolchain_event_post_model = ToolchainEventPost.from_dict(
toolchain_event_post_model_json
)
assert toolchain_event_post_model != False

# Construct a model instance of ToolchainEventPost by calling from_dict on the json representation
toolchain_event_post_model_dict = ToolchainEventPost.from_dict(toolchain_event_post_model_json).__dict__
toolchain_event_post_model2 = ToolchainEventPost(**toolchain_event_post_model_dict)
toolchain_event_post_model_dict = ToolchainEventPost.from_dict(
toolchain_event_post_model_json
).__dict__
toolchain_event_post_model2 = ToolchainEventPost(
**toolchain_event_post_model_dict
)

# Verify the model instances are equivalent
assert toolchain_event_post_model == toolchain_event_post_model2
Expand Down Expand Up @@ -1878,11 +1887,19 @@ def test_toolchain_event_prototype_data_serialization(self):
toolchain_event_prototype_data_model2 = ToolchainEventPrototypeData(**toolchain_event_prototype_data_model_dict)

# Verify the model instances are equivalent
assert toolchain_event_prototype_data_model == toolchain_event_prototype_data_model2
assert (
toolchain_event_prototype_data_model
== toolchain_event_prototype_data_model2
)

# Convert model instance back to dict and verify no loss of data
toolchain_event_prototype_data_model_json2 = toolchain_event_prototype_data_model.to_dict()
assert toolchain_event_prototype_data_model_json2 == toolchain_event_prototype_data_model_json
toolchain_event_prototype_data_model_json2 = (
toolchain_event_prototype_data_model.to_dict()
)
assert (
toolchain_event_prototype_data_model_json2
== toolchain_event_prototype_data_model_json
)


class TestModel_ToolchainEventPrototypeDataApplicationJson:
Expand Down

0 comments on commit 7090a14

Please sign in to comment.