def test_DeleteAllEntriesPersistent(storage_populated, dispatcher,
                                    entry_notifier):
    storage = storage_populated

    storage.m_entries.get("foo2").flags = NT_PERSISTENT
    storage.deleteAllEntries()
    assert len(storage.getEntries("", 0)) == 1
    assert "foo2" in storage.m_entries

    dispatcher._queueOutgoing.assert_has_calls(
        [call(Message.clearEntries(), None, None)])

    entry_notifier.notifyEntry.assert_has_calls(
        [call(ANY, ANY, ANY, NT_NOTIFY_DELETE | NT_NOTIFY_LOCAL)] * 3)
def test_deleteAllEntries(storage_populated, dispatcher, entry_notifier):
    storage = storage_populated

    storage.deleteAllEntries()
    assert len(storage.m_entries) == 4
    assert len(storage.getEntries("", 0)) == 0

    assert storage.m_entries["foo2"].value is None

    dispatcher._queueOutgoing.assert_has_calls(
        [call(Message.clearEntries(), None, None)])

    entry_notifier.notifyEntry.assert_has_calls(
        [call(ANY, ANY, ANY, NT_NOTIFY_DELETE | NT_NOTIFY_LOCAL)] * 4)
def test_deleteAllEntries(storage_populated, dispatcher, entry_notifier):
    storage = storage_populated

    storage.deleteAllEntries()
    assert len(storage.m_entries) == 4
    assert len(storage.getEntries("", 0)) == 0

    assert storage.m_entries["foo2"].value is None

    dispatcher._queueOutgoing.assert_has_calls(
        [call(Message.clearEntries(), None, None)]
    )

    entry_notifier.notifyEntry.assert_has_calls(
        [call(ANY, ANY, ANY, NT_NOTIFY_DELETE | NT_NOTIFY_LOCAL)] * 4
    )
def test_DeleteAllEntriesPersistent(storage_populated, dispatcher, entry_notifier):
    storage = storage_populated

    entry = storage.m_entries.get("foo2")
    entry.flags = NT_PERSISTENT
    entry.isPersistent = True
    storage.deleteAllEntries()
    assert len(storage.getEntries("", 0)) == 1
    assert "foo2" in storage.m_entries

    dispatcher._queueOutgoing.assert_has_calls(
        [call(Message.clearEntries(), None, None)]
    )

    entry_notifier.notifyEntry.assert_has_calls(
        [call(ANY, ANY, ANY, NT_NOTIFY_DELETE | NT_NOTIFY_LOCAL)] * 3
    )
Exemple #5
0
def test_wire_clearEntries(msg_round_trip):
    msg_round_trip(Message.clearEntries(), minver=0x0300)
Exemple #6
0
def test_wire_clearEntries(msg_round_trip):
    msg_round_trip(Message.clearEntries(), minver=0x0300)