Ejemplo n.º 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()
Ejemplo n.º 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()
Ejemplo n.º 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')
Ejemplo n.º 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"