Beispiel #1
0
def test_create_entry():
    group = RootGroup().add_group("test group")
    entry = group.add_entry("test entry")

    assert entry
    assert entry.title == "test entry"

    assert len(group.get_entries()) == 1
    assert entry in group.get_entries()
Beispiel #2
0
def test_create_entry():
    group = RootGroup().add_group("test group")
    entry = group.add_entry("test entry")

    assert entry
    assert entry.title == "test entry"

    assert len(group.get_entries()) == 1
    assert entry in group.get_entries()
Beispiel #3
0
def test_remove_entry_2():
    group = RootGroup().add_group("test group")
    entry = group.add_entry("test entry")

    assert len(group.get_entries()) == 1
    assert entry in group.get_entries()

    entry.remove()

    assert len(group.get_entries()) == 0
Beispiel #4
0
def test_remove_entry_2():
    group = RootGroup().add_group("test group")
    entry = group.add_entry("test entry")

    assert len(group.get_entries()) == 1
    assert entry in group.get_entries()

    entry.remove()

    assert len(group.get_entries()) == 0
Beispiel #5
0
def test_create_entry_with_kwargs():
    group = RootGroup().add_group("test group")

    expire = tomorrow()

    entry = group.add_entry("test entry",
            url="test url",
            username="******",
            password="******",
            comment="test comment",
            expire=expire,
    )

    assert entry
    assert entry.title == "test entry"
    assert entry.url == "test url"
    assert entry.username == "test username"
    assert entry.comment == "test comment"
    assert entry.expire == expire
Beispiel #6
0
def test_create_entry_with_kwargs():
    group = RootGroup().add_group("test group")

    expire = tomorrow()

    entry = group.add_entry(
        "test entry",
        url="test url",
        username="******",
        password="******",
        comment="test comment",
        expire=expire,
    )

    assert entry
    assert entry.title == "test entry"
    assert entry.url == "test url"
    assert entry.username == "test username"
    assert entry.comment == "test comment"
    assert entry.expire == expire
Beispiel #7
0
def test_create_entry_with_invalid_kwargs():
    group = RootGroup().add_group("test group")
    with pytest.raises(ValueError):
        group.add_entry("test entry", foo="bar")
Beispiel #8
0
def test_create_entry_with_invalid_kwargs():
    group = RootGroup().add_group("test group")
    with pytest.raises(ValueError):
        group.add_entry("test entry", foo="bar")