[pim/akonadi-e2e-tests] tests/imap: Prevent name collision in tests with two folder factories

Kevin Ottens <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit dc282cd9e7e22b000b8be31a1b81943624c4c94b by Kevin Ottens.
Committed on 17/07/2026 at 10:09.
Pushed by ervin into branch 'master'.

Prevent name collision in tests with two folder factories

M  +5    -2    tests/imap/test_resource_to_server_imap.py

https://invent.kde.org/pim/akonadi-e2e-tests/-/commit/dc282cd9e7e22b000b8be31a1b81943624c4c94b

diff --git a/tests/imap/test_resource_to_server_imap.py b/tests/imap/test_resource_to_server_imap.py
index 83b2dcc..5f5d181 100644
--- a/tests/imap/test_resource_to_server_imap.py
+++ b/tests/imap/test_resource_to_server_imap.py
@@ -9,6 +9,7 @@ from logging import getLogger
 
 import pytest
 from AkonadiCore import Akonadi  # type: ignore
+from faker import Faker
 from imap_tools import BaseMailBox
 
 from src.akonadi.client import AkonadiClient
@@ -101,7 +102,7 @@ def test_rename_collection(
     initial_collections = imap_resource.list_collections()
     initial_items = imap_resource.list_items(folder.name)
 
-    old_name, new_name = folder.name, fake.word()
+    old_name, new_name = folder.name, fake.word() + fake.word()
     assert old_name in [c.name() for c in initial_collections]
     assert new_name not in [c.name() for c in initial_collections]
 
@@ -298,8 +299,10 @@ def test_move_message_on_resource_is_synced(
     """
     Moving an item from one collection to another in the akonadi server, the change is replayed on the server
     """
+    fake = Faker()
+
     folder1 = ImapFolderFactory.create()
-    folder2 = ImapFolderFactory.create()
+    folder2 = ImapFolderFactory.create(name=fake.word() + fake.word())
     imap_resource.synchronize()
     assert_collection_equal_mailbox(folder1.name, imap_resource, imap_client)
     assert_collection_equal_mailbox(folder2.name, imap_resource, imap_client)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.