From aad2c750bc89e7b92fb1242a9ad228edca651f07 Mon Sep 17 00:00:00 2001 From: phernandez Date: Fri, 7 Feb 2025 16:12:25 -0600 Subject: [PATCH] fix sync test --- tests/sync/test_sync_service.py | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/tests/sync/test_sync_service.py b/tests/sync/test_sync_service.py index 2993b08c..a2e332e9 100644 --- a/tests/sync/test_sync_service.py +++ b/tests/sync/test_sync_service.py @@ -778,14 +778,28 @@ test content # Check permalinks file_two_content, _ = await file_service.read_file(two_file) - assert "permalink: one-1" in file_two_content + assert "permalink: two" in file_two_content + + # new content with duplicate permalink + new_content = """ +--- +title: new.md +type: note +permalink: one +tags: [] +--- + +test content +""" + new_file = project_dir / "new.md" + await create_test_file(new_file) # Run another time await sync_service.sync(test_config.home) # Should still have same permalink - file_one_content, _ = await file_service.read_file(two_file) - assert "permalink: one-1" in file_one_content + new_file_content, _ = await file_service.read_file(new_file) + assert "permalink: new" in new_file_content