def test_get_login_personal_uri(capsys):
    CliSimple('script', 'get', 'uri', common_data('uuid_login_personal')).run()
    std = capsys.readouterr()
    assert std.out == 'login_p_uri1'
Exemple #2
0
def start():
    cli = CliSimple(*sys.argv)
    cli.run()
def test_get_login_organization_username(cli_get_uuid_username, capsys):
    CliSimple('script', 'get', 'username', common_data('uuid_login_organization')).run()
    std = capsys.readouterr()
    assert std.out == 'acme_login1'
def cli_version():
    return CliSimple('script', 'version')
def test_get_wrong_field():
    with pytest.raises(SystemExit) as e:
        CliSimple('script', 'get', 'unexisting', common_data('uuid_note_personal')).run()
    assert e.type == SystemExit
    assert e.value.code == 'Unable to find field unexisting for entry with id: ' + common_data('uuid_note_personal')
def cli_get_uuid_username():
    return CliSimple('script', 'get', 'username', common_data('uuid_login_personal'))
def test_list(capsys):
    CliSimple('script', 'list').run()
    std = capsys.readouterr()
    assert std.out == \
"fe6e74aa-a099-4cc1-ae8e-aa3000d02c14 acme login 1\n\
def test_get_wrong_uuid():
    with pytest.raises(SystemExit) as e:
        CliSimple('script', 'get', 'name', 'wrong-uuid').run()
    assert e.type == SystemExit
    assert e.value.code == 'Unable to find entry with id: wrong-uuid'
def cli_get_empty():
    return CliSimple('script', 'get')
def test_get_note_personal_customfield(capsys):
    CliSimple('script', 'get', 'note_p_custom_field_text', common_data('uuid_note_personal')).run()
    std = capsys.readouterr()
    assert std.out == 'note_p_custom_field_text_value'
def test_get_login_personal_custom_field_unchecked(cli_get_uuid_username, capsys):
    CliSimple('script', 'get', 'login_p_custom_unchecked', common_data('uuid_login_personal')).run()
    std = capsys.readouterr()
    assert std.out == 'false'
def test_get_login_personal_custom_field_hidden(cli_get_uuid_username, capsys):
    CliSimple('script', 'get', 'login_p_custom_hidden', common_data('uuid_login_personal')).run()
    std = capsys.readouterr()
    assert std.out == 'login_p_custom_hidden_value'
def test_get_login_organization_custom_field_text(cli_get_uuid_username, capsys):
    CliSimple('script', 'get', 'acme_login1_customfield_text1', common_data('uuid_login_organization')).run()
    std = capsys.readouterr()
    assert std.out == 'acme_login1_customfield_text1_value'
def test_get_note_personal_name(capsys):
    CliSimple('script', 'get', 'name', common_data('uuid_note_personal')).run()
    std = capsys.readouterr()
    assert std.out == 'note personal'
def cli_empty():
    return CliSimple('script')