From 38827b29b8ee3d4cccb0435e74d5fc8073b1bcf2 Mon Sep 17 00:00:00 2001 From: kbalk <7536198+kbalk@users.noreply.github.com> Date: Fri, 4 Aug 2023 10:14:46 -0400 Subject: [PATCH] Replace sure with regular assertions in signer (#6595) --- tests/test_signer/test_signing_platforms.py | 8 ++---- tests/test_signer/test_signing_profiles.py | 31 +++++++++------------ 2 files changed, 16 insertions(+), 23 deletions(-) diff --git a/tests/test_signer/test_signing_platforms.py b/tests/test_signer/test_signing_platforms.py index 1000be347..4cfdac3dd 100644 --- a/tests/test_signer/test_signing_platforms.py +++ b/tests/test_signer/test_signing_platforms.py @@ -1,7 +1,6 @@ """Unit tests for signer-supported APIs.""" import boto3 -import sure # noqa # pylint: disable=unused-import from moto import mock_signer # See our Development Tips on writing tests for hints on how to write good tests: @@ -13,9 +12,8 @@ def test_list_signing_platforms(): client = boto3.client("signer", region_name="us-east-2") resp = client.list_signing_platforms() - resp.should.have.key("platforms").should.have.length_of(4) + assert "platforms" in resp + assert len(resp["platforms"]) == 4 partners = [x["partner"] for x in resp["platforms"]] - set(partners).should.equal( - {"AmazonFreeRTOS", "AWSLambda", "AWSIoTDeviceManagement"} - ) + assert set(partners) == {"AmazonFreeRTOS", "AWSLambda", "AWSIoTDeviceManagement"} diff --git a/tests/test_signer/test_signing_profiles.py b/tests/test_signer/test_signing_profiles.py index e7d90ab06..3e52b4337 100644 --- a/tests/test_signer/test_signing_profiles.py +++ b/tests/test_signer/test_signing_profiles.py @@ -1,7 +1,6 @@ """Unit tests for signer-supported APIs.""" import boto3 -import sure # noqa # pylint: disable=unused-import from moto import mock_signer # See our Development Tips on writing tests for hints on how to write good tests: @@ -13,9 +12,9 @@ def test_put_signing_profile(): client = boto3.client("signer", region_name="eu-west-1") resp = client.put_signing_profile(profileName="prof1", platformId="pid") - resp.should.have.key("arn") - resp.should.have.key("profileVersion") - resp.should.have.key("profileVersionArn") + assert "arn" in resp + assert "profileVersion" in resp + assert "profileVersionArn" in resp @mock_signer @@ -27,15 +26,13 @@ def test_get_signing_profile(): resp = client.get_signing_profile(profileName="prof1") - resp.should.have.key("arn") - resp.should.have.key("profileVersion") - resp.should.have.key("profileVersionArn") - resp.should.have.key("status").equals("Active") - resp.should.have.key("profileName").equals("prof1") - resp.should.have.key("platformId").equals("AWSLambda-SHA384-ECDSA") - resp.should.have.key("signatureValidityPeriod").equals( - {"type": "MONTHS", "value": 135} - ) + assert "arn" in resp + assert "profileVersion" in resp + assert "profileVersionArn" in resp + assert resp["status"] == "Active" + assert resp["profileName"] == "prof1" + assert resp["platformId"] == "AWSLambda-SHA384-ECDSA" + assert resp["signatureValidityPeriod"] == {"type": "MONTHS", "value": 135} @mock_signer @@ -50,10 +47,8 @@ def test_get_signing_profile__with_args(): resp = client.get_signing_profile(profileName="prof1") - resp.should.have.key("signatureValidityPeriod").equals( - {"type": "DAYS", "value": 10} - ) - resp.should.have.key("tags").equals({"k1": "v1", "k2": "v2"}) + assert resp["signatureValidityPeriod"] == {"type": "DAYS", "value": 10} + assert resp["tags"] == {"k1": "v1", "k2": "v2"} @mock_signer @@ -67,4 +62,4 @@ def test_cancel_signing_profile(): resp = client.get_signing_profile(profileName="prof1") - resp.should.have.key("status").equals("Canceled") + assert resp["status"] == "Canceled"