Exemple #1
0
def test_valid_cache_session_no_session_token():
    result = cache.valid_cache_session({
        'AccessKeyId': 'AKIA...',
        'SecretAccessKey': 'SECRET',
        'Expiration': datetime.now() + timedelta(hours=1),
    })
    assert result is False
Exemple #2
0
def test_valid_cache_session_no_expiration():
    result = cache.valid_cache_session({
        'AccessKeyId': 'AKIA...',
        'SecretAccessKey': 'SECRET',
        'SessionToken': 'LONGSECRET',
    })
    assert result is True
Exemple #3
0
def test_valid_cache_session_no_access_key_id():
    result = cache.valid_cache_session({
        'SecretAccessKey': 'SECRET',
        'SessionToken': 'LONGSECRET',
        'Expiration': datetime.now() + timedelta(hours=1),
    })
    assert result is False
Exemple #4
0
def test_valid_cache_session_datetime_str():
    result = cache.valid_cache_session({
        'AccessKeyId': 'AKIA...',
        'SecretAccessKey': 'SECRET',
        'SessionToken': 'LONGSECRET',
        'Expiration': '2065-10-24 12:24:36',
    })
    assert result is True