From 75d41a4b4bf274fa67ac0ea27b577d0b9bd22636 Mon Sep 17 00:00:00 2001 From: RinCodeForge927 Date: Tue, 30 Dec 2025 16:31:13 +0700 Subject: [PATCH] test: ensure page exists before attaching files Co-authored-by: RinCodeForge927 --- tests/test_confluence_attach.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/test_confluence_attach.py b/tests/test_confluence_attach.py index 3761ce2ce..8cc62b9bf 100644 --- a/tests/test_confluence_attach.py +++ b/tests/test_confluence_attach.py @@ -42,7 +42,9 @@ def test_confluence_attach_file_1(self): space = "SAN" title = "atlassian-python-rest-api-wrapper" - # TODO: check if page are exists + # check if page exists, create if not + if not confluence.page_exists(space, title): + confluence.create_page(space, title, "Initial content for testing") fd, filename = tempfile.mkstemp("w") os.write(fd, b"Hello World - Version 1") @@ -87,7 +89,9 @@ def test_confluence_attach_file_2(self): space = "SAN" title = "atlassian-python-rest-api-wrapper" - # TODO: check if page are exists + # check if page exists, create if not + if not confluence.page_exists(space, title): + confluence.create_page(space, title, "Initial content for testing") fd, filename = tempfile.mkstemp("w") os.write(fd, b"Hello World - Version 1")