Cognito - Dont run test in ServerMode

This commit is contained in:
Bert Blommers 2020-06-20 12:48:10 +01:00
parent 655b92a2a4
commit f27e29e04d

View File

@ -14,7 +14,7 @@ from botocore.exceptions import ClientError
from jose import jws, jwk, jwt from jose import jws, jwk, jwt
from nose.tools import assert_raises from nose.tools import assert_raises
from moto import mock_cognitoidp from moto import mock_cognitoidp, settings
from moto.core import ACCOUNT_ID from moto.core import ACCOUNT_ID
@ -1312,8 +1312,12 @@ def test_admin_update_user_attributes():
val.should.equal("Jane") val.should.equal("Jane")
@mock_cognitoidp # Test will retrieve public key from cognito.amazonaws.com/.well-known/jwks.json,
def test_idtoken_contains_kid_header(): # which isnt mocked in ServerMode
if not settings.TEST_SERVER_MODE:
@mock_cognitoidp
def test_idtoken_contains_kid_header():
# https://github.com/spulec/moto/issues/3078 # https://github.com/spulec/moto/issues/3078
# Setup # Setup
cognito = boto3.client("cognito-idp", "us-west-2") cognito = boto3.client("cognito-idp", "us-west-2")
@ -1335,7 +1339,9 @@ def test_idtoken_contains_kid_header():
username = str(uuid.uuid4()) username = str(uuid.uuid4())
temporary_password = "1TemporaryP@ssword" temporary_password = "1TemporaryP@ssword"
cognito.admin_create_user( cognito.admin_create_user(
UserPoolId=user_pool_id, Username=username, TemporaryPassword=temporary_password UserPoolId=user_pool_id,
Username=username,
TemporaryPassword=temporary_password,
) )
result = cognito.admin_initiate_auth( result = cognito.admin_initiate_auth(
UserPoolId=user_pool_id, UserPoolId=user_pool_id,