Esempio n. 1
0
def test_get_token_from_ykey(monkeypatch, tmp_path):
    monkeypatch.setenv('HOME', str(tmp_path))
    init_tmpdir(tmp_path, 'expired')
    from awsmfav2.cli import CLI
    with mock.patch.object(CLI, '_get_ykey_token', return_value=123456):
        with mock.patch.object(CLI, '_ykey_is_present', return_value=True):
            cli = CLI()
            assert (cli._get_token() == 123456)
Esempio n. 2
0
def test_get_token_from_ykey(monkeypatch, tmp_path):
    monkeypatch.setenv("HOME", str(tmp_path))
    init_tmpdir(tmp_path, "expired")
    from awsmfav2.cli import CLI

    with mock.patch.object(CLI, "_get_ykey_token", return_value=123456):
        with mock.patch.object(CLI, "_ykey_is_present", return_value=True):
            cli = CLI()
            assert cli._get_token() == 123456