diff --git a/atlassian/confluence/__init__.py b/atlassian/confluence/__init__.py index 5ac9fb324..e26099383 100644 --- a/atlassian/confluence/__init__.py +++ b/atlassian/confluence/__init__.py @@ -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) diff --git a/atlassian/confluence/cloud/base.py b/atlassian/confluence/cloud/base.py index ec2a081b0..f90f43f5f 100644 --- a/atlassian/confluence/cloud/base.py +++ b/atlassian/confluence/cloud/base.py @@ -23,5 +23,3 @@ def __init__(self, url, *args, **kwargs): :return: nothing """ super(ConfluenceCloudBase, self).__init__(url, *args, **kwargs) - - diff --git a/atlassian/confluence/server/__init__.py b/atlassian/confluence/server/__init__.py index 50ccc9978..65199e083 100644 --- a/atlassian/confluence/server/__init__.py +++ b/atlassian/confluence/server/__init__.py @@ -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): @@ -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): diff --git a/atlassian/confluence/server/base.py b/atlassian/confluence/server/base.py index f7451db93..0bfd53963 100644 --- a/atlassian/confluence/server/base.py +++ b/atlassian/confluence/server/base.py @@ -23,5 +23,3 @@ def __init__(self, url, *args, **kwargs): :return: nothing """ super(ConfluenceServerBase, self).__init__(url, *args, **kwargs) - - diff --git a/tests/confluence/test_confluence_cloud.py b/tests/confluence/test_confluence_cloud.py index b7f874147..55af107e1 100644 --- a/tests/confluence/test_confluence_cloud.py +++ b/tests/confluence/test_confluence_cloud.py @@ -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" diff --git a/tests/confluence/test_confluence_routing.py b/tests/confluence/test_confluence_routing.py index aa16abd4b..96a5aa82e 100644 --- a/tests/confluence/test_confluence_routing.py +++ b/tests/confluence/test_confluence_routing.py @@ -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