[pim/akonadi-e2e-tests] tests/selftest: Make the resource offline for infra tests testing the Akonadi side only
Kevin Ottens <[email protected]>
| Newsgroups | gmane.comp.kde.cvs |
|---|---|
| Message-ID | <[email protected]> |
Git commit 0dede7a956ef5c4ce91ac65e4f9c63362b915494 by Kevin Ottens.
Committed on 16/07/2026 at 19:41.
Pushed by ervin into branch 'master'.
Make the resource offline for infra tests testing the Akonadi side only
It's not needed to make the test flaky due to how the resource behave
when it's online. We got other tests for that. Since we're checking only
if collections and items are properly created on the Akonadi side, just
make the resource offline.
M +6 -4 tests/selftest/test_factories.py
https://invent.kde.org/pim/akonadi-e2e-tests/-/commit/0dede7a956ef5c4ce91ac65e4f9c63362b915494
diff --git a/tests/selftest/test_factories.py b/tests/selftest/test_factories.py
index 2ff8b92..69176ef 100644
--- a/tests/selftest/test_factories.py
+++ b/tests/selftest/test_factories.py
@@ -56,16 +56,19 @@ def test_imap_factory_sub_folder(imap_resource: ImapResource, imap_client: BaseM
def test_imap_resource_factory(imap_resource: ImapResource, imap_client: BaseMailBox): # noqa: ARG001
+ imap_resource.set_online(False)
+
AkonadiFolderFactory.create(name="Test", nb_items=5)
AkonadiEmailFactory.create_batch(10, folder="INBOX")
- imap_resource.wait_resource_is_idle()
assert len(imap_resource.list_collections()) == 3 # INBOX, Test and IMAP Account
assert len(imap_resource.list_items("INBOX")) == 10
assert len(imap_resource.list_items("Test")) == 5
def test_imap_resource_factory_sub_folder(imap_resource: ImapResource, imap_client: BaseMailBox): # noqa: ARG001
+ imap_resource.set_online(False)
+
parent = AkonadiFolderFactory.create(name="Parent", nb_items=3)
child1 = AkonadiFolderFactory.create(name="Child1", parent=parent, nb_items=4)
child2 = AkonadiFolderFactory.create(name="Child2", parent=parent, nb_items=5)
@@ -75,8 +78,6 @@ def test_imap_resource_factory_sub_folder(imap_resource: ImapResource, imap_clie
assert parent.parent is None
assert child1.parent.name == child2.parent.name == parent.name
- imap_resource.wait_resource_is_idle()
-
collection_parent = parent.get_collection()
collection_child1 = child1.get_collection()
collection_child2 = child2.get_collection()
@@ -102,8 +103,9 @@ def test_dav_factory(groupware_resource: DAVResource, dav_principal: Principal):
def test_dav_resource_factory(groupware_resource: DAVResource, dav_principal: Principal): # noqa: ARG001
+ groupware_resource.set_online(False)
+
AkonadiEventFactory.create_batch(10, calendar="Default Calendar")
- groupware_resource.wait_resource_is_idle()
assert (
len(groupware_resource.list_collections()) == 2
) # Default Calendar and resource collection