Skip to content

Commit 2437637

Browse files
authored
test: ensure page exists before attaching files (#1608)
1 parent efcfb44 commit 2437637

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

tests/test_confluence_attach.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ def test_confluence_attach_file_1(self):
4242
space = "SAN"
4343
title = "atlassian-python-rest-api-wrapper"
4444

45-
# TODO: check if page are exists
45+
# check if page exists, create if not
46+
if not confluence.page_exists(space, title):
47+
confluence.create_page(space, title, "Initial content for testing")
4648

4749
fd, filename = tempfile.mkstemp("w")
4850
os.write(fd, b"Hello World - Version 1")
@@ -87,7 +89,9 @@ def test_confluence_attach_file_2(self):
8789
space = "SAN"
8890
title = "atlassian-python-rest-api-wrapper"
8991

90-
# TODO: check if page are exists
92+
# check if page exists, create if not
93+
if not confluence.page_exists(space, title):
94+
confluence.create_page(space, title, "Initial content for testing")
9195

9296
fd, filename = tempfile.mkstemp("w")
9397
os.write(fd, b"Hello World - Version 1")

0 commit comments

Comments
 (0)