Ejemplo n.º 1
0
def test_get_mfa_creds_unexpired(monkeypatch, tmp_path):
    '''
    Test that we can actually call mock STS and get back creds
    '''
    monkeypatch.setenv('HOME', str(tmp_path))
    init_tmpdir(tmp_path, 'unexpired')
    from awsmfav2.cli import CLI
    cli = CLI()
    updated, creds = cli._get_mfa_creds()
    assert (updated == False)
    assert (isinstance(creds['aws_access_key_id'], str))
    assert (isinstance(creds['aws_secret_access_key'], str))
    assert (isinstance(creds['aws_session_token'], str))
    assert (isinstance(creds['expiration'], str))
Ejemplo n.º 2
0
def test_get_mfa_creds_unexpired(monkeypatch, tmp_path):
    """
    Test that we can actually call mock STS and get back creds
    """
    monkeypatch.setenv("HOME", str(tmp_path))
    init_tmpdir(tmp_path, "unexpired")
    from awsmfav2.cli import CLI

    cli = CLI()
    updated, creds = cli._get_mfa_creds()
    assert updated == False
    assert isinstance(creds["aws_access_key_id"], str)
    assert isinstance(creds["aws_secret_access_key"], str)
    assert isinstance(creds["aws_session_token"], str)
    assert isinstance(creds["expiration"], str)