Replace sure with regular assertions in signer (#6595)
This commit is contained in:
parent
6a2131358a
commit
38827b29b8
@ -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"}
|
||||
|
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user