Skip checking the expiration of AssumedRole in server mode.

This commit is contained in:
acsbendi 2019-08-22 11:06:42 +02:00
parent 3012740699
commit addb631081

View File

@ -9,7 +9,7 @@ from nose.tools import assert_raises
import sure # noqa import sure # noqa
from moto import mock_sts, mock_sts_deprecated, mock_iam from moto import mock_sts, mock_sts_deprecated, mock_iam, settings
from moto.iam.models import ACCOUNT_ID from moto.iam.models import ACCOUNT_ID
from moto.sts.responses import MAX_FEDERATION_TOKEN_POLICY_LENGTH from moto.sts.responses import MAX_FEDERATION_TOKEN_POLICY_LENGTH
@ -72,6 +72,7 @@ def test_assume_role():
Policy=policy, DurationSeconds=900) Policy=policy, DurationSeconds=900)
credentials = assume_role_response['Credentials'] credentials = assume_role_response['Credentials']
if not settings.TEST_SERVER_MODE:
credentials['Expiration'].isoformat().should.equal('2012-01-01T12:15:00+00:00') credentials['Expiration'].isoformat().should.equal('2012-01-01T12:15:00+00:00')
credentials['SessionToken'].should.have.length_of(356) credentials['SessionToken'].should.have.length_of(356)
assert credentials['SessionToken'].startswith("FQoGZXIvYXdzE") assert credentials['SessionToken'].startswith("FQoGZXIvYXdzE")