Replace sure with regular assertions in signer (#6595)

This commit is contained in:
kbalk 2023-08-04 10:14:46 -04:00 committed by GitHub
parent 6a2131358a
commit 38827b29b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 23 deletions

View File

@ -1,7 +1,6 @@
"""Unit tests for signer-supported APIs.""" """Unit tests for signer-supported APIs."""
import boto3 import boto3
import sure # noqa # pylint: disable=unused-import
from moto import mock_signer from moto import mock_signer
# See our Development Tips on writing tests for hints on how to write good tests: # 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") client = boto3.client("signer", region_name="us-east-2")
resp = client.list_signing_platforms() 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"]] partners = [x["partner"] for x in resp["platforms"]]
set(partners).should.equal( assert set(partners) == {"AmazonFreeRTOS", "AWSLambda", "AWSIoTDeviceManagement"}
{"AmazonFreeRTOS", "AWSLambda", "AWSIoTDeviceManagement"}
)

View File

@ -1,7 +1,6 @@
"""Unit tests for signer-supported APIs.""" """Unit tests for signer-supported APIs."""
import boto3 import boto3
import sure # noqa # pylint: disable=unused-import
from moto import mock_signer from moto import mock_signer
# See our Development Tips on writing tests for hints on how to write good tests: # 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") client = boto3.client("signer", region_name="eu-west-1")
resp = client.put_signing_profile(profileName="prof1", platformId="pid") resp = client.put_signing_profile(profileName="prof1", platformId="pid")
resp.should.have.key("arn") assert "arn" in resp
resp.should.have.key("profileVersion") assert "profileVersion" in resp
resp.should.have.key("profileVersionArn") assert "profileVersionArn" in resp
@mock_signer @mock_signer
@ -27,15 +26,13 @@ def test_get_signing_profile():
resp = client.get_signing_profile(profileName="prof1") resp = client.get_signing_profile(profileName="prof1")
resp.should.have.key("arn") assert "arn" in resp
resp.should.have.key("profileVersion") assert "profileVersion" in resp
resp.should.have.key("profileVersionArn") assert "profileVersionArn" in resp
resp.should.have.key("status").equals("Active") assert resp["status"] == "Active"
resp.should.have.key("profileName").equals("prof1") assert resp["profileName"] == "prof1"
resp.should.have.key("platformId").equals("AWSLambda-SHA384-ECDSA") assert resp["platformId"] == "AWSLambda-SHA384-ECDSA"
resp.should.have.key("signatureValidityPeriod").equals( assert resp["signatureValidityPeriod"] == {"type": "MONTHS", "value": 135}
{"type": "MONTHS", "value": 135}
)
@mock_signer @mock_signer
@ -50,10 +47,8 @@ def test_get_signing_profile__with_args():
resp = client.get_signing_profile(profileName="prof1") resp = client.get_signing_profile(profileName="prof1")
resp.should.have.key("signatureValidityPeriod").equals( assert resp["signatureValidityPeriod"] == {"type": "DAYS", "value": 10}
{"type": "DAYS", "value": 10} assert resp["tags"] == {"k1": "v1", "k2": "v2"}
)
resp.should.have.key("tags").equals({"k1": "v1", "k2": "v2"})
@mock_signer @mock_signer
@ -67,4 +62,4 @@ def test_cancel_signing_profile():
resp = client.get_signing_profile(profileName="prof1") resp = client.get_signing_profile(profileName="prof1")
resp.should.have.key("status").equals("Canceled") assert resp["status"] == "Canceled"