Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions atlassian/confluence/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,12 @@ def __init__(self, url, *args, **kwargs):
if is_cloud is None:
hostname = urlparse(url).hostname or ""
is_cloud = (
hostname == "atlassian.net" or hostname.endswith(".atlassian.net")
or hostname == "jira.com" or hostname.endswith(".jira.com")
or hostname == "api.atlassian.com" or hostname.endswith(".api.atlassian.com")
hostname == "atlassian.net"
or hostname.endswith(".atlassian.net")
or hostname == "jira.com"
or hostname.endswith(".jira.com")
or hostname == "api.atlassian.com"
or hostname.endswith(".api.atlassian.com")
)
if is_cloud:
impl = ConfluenceCloud(url, *args, **kwargs)
Expand Down
2 changes: 0 additions & 2 deletions atlassian/confluence/cloud/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,3 @@ def __init__(self, url, *args, **kwargs):
:return: nothing
"""
super(ConfluenceCloudBase, self).__init__(url, *args, **kwargs)


8 changes: 6 additions & 2 deletions atlassian/confluence/server/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,9 @@ def get_all_draft_pages_from_space(self, space_key, **kwargs):

def get_all_draft_blog_posts_from_space(self, space_key, **kwargs):
"""Get all draft blog posts from space."""
return self._get_paged("content", params={"spaceKey": space_key, "type": "blogpost", "status": "draft", **kwargs})
return self._get_paged(
"content", params={"spaceKey": space_key, "type": "blogpost", "status": "draft", **kwargs}
)

# Trash Management
def get_trash_content(self, space_key, **kwargs):
Expand All @@ -310,7 +312,9 @@ def get_all_pages_from_space_trash(self, space_key, **kwargs):

def get_all_blog_posts_from_space_trash(self, space_key, **kwargs):
"""Get all blog posts from space trash."""
return self._get_paged("content", params={"spaceKey": space_key, "type": "blogpost", "status": "trashed", **kwargs})
return self._get_paged(
"content", params={"spaceKey": space_key, "type": "blogpost", "status": "trashed", **kwargs}
)

# Export
def export_content(self, content_id, **kwargs):
Expand Down
2 changes: 0 additions & 2 deletions atlassian/confluence/server/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,3 @@ def __init__(self, url, *args, **kwargs):
:return: nothing
"""
super(ConfluenceServerBase, self).__init__(url, *args, **kwargs)


2 changes: 1 addition & 1 deletion tests/confluence/test_confluence_cloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ def test_pagination_with_relative_next_link_and_base(self, mock_get, confluence_
assert result == [{"id": "1", "title": "Page 1"}, {"id": "2", "title": "Page 2"}]

assert mock_get.call_count == 2

# Verify the second call used scheme+host from self.url (preserving API gateway routing)
args, kwargs = mock_get.call_args_list[1]
assert args[0] == "https://test.atlassian.net/rest/api/content?cursor=1"
Expand Down
6 changes: 4 additions & 2 deletions tests/confluence/test_confluence_routing.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# coding=utf-8
"""Tests for legacy Confluence class URL routing."""

from unittest.mock import patch, MagicMock
from unittest.mock import patch

import pytest
# from unittest.mock import MagicMock

# import pytest

from atlassian.confluence import Confluence, ConfluenceCloud, ConfluenceServer

Expand Down
Loading