From 618bf6351f984530f264e7c09c1a15cc521de627 Mon Sep 17 00:00:00 2001 From: vil02 <65706193+vil02@users.noreply.github.com> Date: Wed, 5 Feb 2025 20:34:55 +0100 Subject: [PATCH] [style] Do not use `is` to compare literals --- fixcore/tests/fixcore/model/model_test.py | 2 +- fixcore/tests/fixcore/util_test.py | 8 ++++---- plugins/aws/fix_plugin_aws/resource/dynamodb.py | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/fixcore/tests/fixcore/model/model_test.py b/fixcore/tests/fixcore/model/model_test.py index 0110010905..388e790318 100644 --- a/fixcore/tests/fixcore/model/model_test.py +++ b/fixcore/tests/fixcore/model/model_test.py @@ -104,7 +104,7 @@ def test_number() -> None: assert int32.coerce_if_required("no number") is None assert int32.check_valid(1) is None assert int32.check_valid(8) is None - assert int32.check_valid("8") is 8 + assert int32.check_valid("8") == 8 assert expect_error(int32, "7.123") == "Expected type int32 but got str" assert flot.check_valid("7.123") == 7.123 assert expect_error(int32, 0) == ">0< should be greater or equals than: 1" diff --git a/fixcore/tests/fixcore/util_test.py b/fixcore/tests/fixcore/util_test.py index 5a688f3366..e38d44e96d 100644 --- a/fixcore/tests/fixcore/util_test.py +++ b/fixcore/tests/fixcore/util_test.py @@ -43,14 +43,14 @@ def test_access_json() -> None: assert access.a == "a" assert access.b.d.f[2] == 2 assert access.this == js - assert str(access.b.d.f[99]) is "null" - assert str(access.b.d.f["test"]) is "null" - assert str(access.foo.bla.bar[23].now) is "null" + assert str(access.b.d.f[99]) == "null" + assert str(access.b.d.f["test"]) == "null" + assert str(access.foo.bla.bar[23].now) == "null" assert json.dumps(access.b.d, sort_keys=True) == '{"e": "e", "f": [0, 1, 2, 3, 4]}' assert access["a"] == "a" assert access["b"]["d"]["f"][2] == 2 - assert str(access["foo"]["bla"]["bar"][23]["now"]) is "null" + assert str(access["foo"]["bla"]["bar"][23]["now"]) == "null" assert json.dumps(access["b"]["d"], sort_keys=True) == '{"e": "e", "f": [0, 1, 2, 3, 4]}' assert [a for a in access] == ["a", "b"] diff --git a/plugins/aws/fix_plugin_aws/resource/dynamodb.py b/plugins/aws/fix_plugin_aws/resource/dynamodb.py index 92199b8c2b..f98a6df0ae 100644 --- a/plugins/aws/fix_plugin_aws/resource/dynamodb.py +++ b/plugins/aws/fix_plugin_aws/resource/dynamodb.py @@ -607,7 +607,7 @@ def add_tags(table: AwsDynamoDbGlobalTable) -> None: builder.submit_work(service_name, add_instance, js) def connect_in_graph(self, builder: GraphBuilder, source: Json) -> None: - if self.dynamodb_replication_group is not []: + if self.dynamodb_replication_group != []: for replica in self.dynamodb_replication_group: if replica.kms_master_key_id: builder.dependant_node(