Beispiel #1
0
def test_main_expired_creds(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, 'expired')
    from awsmfav2.cli import CLI
    cli = CLI()
    cli.main()
Beispiel #2
0
def test_main_expired_creds(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, "expired")
    from awsmfav2.cli import CLI

    cli = CLI()
    cli.main()
Beispiel #3
0
def test_main_unexpired_creds(monkeypatch, tmp_path):
    '''
    Test that we can actually call mock STS and get back creds
    '''
    monkeypatch.setenv('HOME', str(tmp_path))
    monkeypatch.setenv('AWS_MFA_DURATION', '900')
    init_tmpdir(tmp_path, 'unexpired')
    from awsmfav2.cli import CLI
    cli = CLI()
    cli.main()
    assert (cli._get_argument('duration') == '900')
Beispiel #4
0
def test_main_unexpired_creds(monkeypatch, tmp_path):
    """
    Test that we can actually call mock STS and get back creds
    """
    monkeypatch.setenv("HOME", str(tmp_path))
    monkeypatch.setenv("AWS_MFA_DURATION", "900")
    init_tmpdir(tmp_path, "unexpired")
    from awsmfav2.cli import CLI

    cli = CLI()
    cli.main()
    assert cli._get_argument("duration") == "900"