From cfde8286d57e041cacf5b21e71c2a15c5320fc3d Mon Sep 17 00:00:00 2001 From: Gonchik Tsymzhitov Date: Wed, 6 Dec 2023 11:52:06 +0200 Subject: [PATCH] black polish --- examples/bitbucket/bitbucket_pr_commits.py | 2 +- temp_file.md | 0 .../pullrequests/1/commits/GET | 172 +++++++++--------- tests/test_bitbucket_cloud_oo.py | 3 +- 4 files changed, 85 insertions(+), 92 deletions(-) delete mode 100644 temp_file.md diff --git a/examples/bitbucket/bitbucket_pr_commits.py b/examples/bitbucket/bitbucket_pr_commits.py index a93993f63..9dbfddc8c 100644 --- a/examples/bitbucket/bitbucket_pr_commits.py +++ b/examples/bitbucket/bitbucket_pr_commits.py @@ -1,6 +1,6 @@ from atlassian.bitbucket import Cloud -bitbucket = Cloud(url='https://api.bitbucket.org/', token='random_string_token') +bitbucket = Cloud(url="https://api.bitbucket.org/", token="random_string_token") pr_id = 1 diff --git a/temp_file.md b/temp_file.md deleted file mode 100644 index e69de29bb..000000000 diff --git a/tests/responses/bitbucket/cloud/2.0/repositories/TestWorkspace1/testrepository1/pullrequests/1/commits/GET b/tests/responses/bitbucket/cloud/2.0/repositories/TestWorkspace1/testrepository1/pullrequests/1/commits/GET index 0f960ae00..c539b167d 100644 --- a/tests/responses/bitbucket/cloud/2.0/repositories/TestWorkspace1/testrepository1/pullrequests/1/commits/GET +++ b/tests/responses/bitbucket/cloud/2.0/repositories/TestWorkspace1/testrepository1/pullrequests/1/commits/GET @@ -1,94 +1,88 @@ responses[None] = { - "values": [ - { - "type": "commit", - "hash": "3a8d6c7910f7bf68f7cf9cc1964998006fa8894b", - "date": "2023-10-08T17:31:20+00:00", - "author": { - "type": "author", - "raw": "user1Name ", - "user": { - "display_name": "user1Name", - "links": { - "self": { - "href": "https://api.bitbucket.org/2.0/users/%7B34318d8b-6c8a-40a7-aea2-572fdd183917%7D" + "values": [ + { + "type": "commit", + "hash": "3a8d6c7910f7bf68f7cf9cc1964998006fa8894b", + "date": "2023-10-08T17:31:20+00:00", + "author": { + "type": "author", + "raw": "user1Name ", + "user": { + "display_name": "user1Name", + "links": { + "self": { + "href": "https://api.bitbucket.org/2.0/users/%7B34318d8b-6c8a-40a7-aea2-572fdd183917%7D" + }, + "avatar": { + "href": "https://secure.gravatar.com/avatar/679c684730037c1250b46c1781701f98?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FIP-3.png" + }, + "html": {"href": "https://bitbucket.org/%7B34318d8b-6c8a-40a7-aea2-572fdd183917%7D/"}, + }, + "type": "user", + "uuid": "{34318d8b-6c8a-40a7-aea2-572fdd183917}", + "account_id": "557058:e7042a01-54b7-447f-9da8-4ad1b1e4afa5", + "nickname": "user1Name", + }, }, - "avatar": { - "href": "https://secure.gravatar.com/avatar/679c684730037c1250b46c1781701f98?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FIP-3.png" + "message": "src created online with Bitbucket", + "summary": { + "type": "rendered", + "raw": "src created online with Bitbucket", + "markup": "markdown", + "html": "

src created online with Bitbucket

", }, - "html": { - "href": "https://bitbucket.org/%7B34318d8b-6c8a-40a7-aea2-572fdd183917%7D/" - } - }, - "type": "user", - "uuid": "{34318d8b-6c8a-40a7-aea2-572fdd183917}", - "account_id": "557058:e7042a01-54b7-447f-9da8-4ad1b1e4afa5", - "nickname": "user1Name" - } - }, - "message": "src created online with Bitbucket", - "summary": { - "type": "rendered", - "raw": "src created online with Bitbucket", - "markup": "markdown", - "html": "

src created online with Bitbucket

" - }, - "links": { - "self": { - "href": "https://api.bitbucket.org/2.0/repositories/TestWorkspace1/testrepository1/commit/3a8d6c7910f7bf68f7cf9cc1964998006fa8894b" - }, - "html": { - "href": "https://bitbucket.org/TestWorkspace1/testrepository1/commits/3a8d6c7910f7bf68f7cf9cc1964998006fa8894b" - }, - "diff": { - "href": "https://api.bitbucket.org/2.0/repositories/TestWorkspace1/testrepository1/diff/3a8d6c7910f7bf68f7cf9cc1964998006fa8894b" - }, - "approve": { - "href": "https://api.bitbucket.org/2.0/repositories/TestWorkspace1/testrepository1/commit/3a8d6c7910f7bf68f7cf9cc1964998006fa8894b/approve" - }, - "comments": { - "href": "https://api.bitbucket.org/2.0/repositories/TestWorkspace1/testrepository1/commit/3a8d6c7910f7bf68f7cf9cc1964998006fa8894b/comments" - }, - "statuses": { - "href": "https://api.bitbucket.org/2.0/repositories/TestWorkspace1/testrepository1/commit/3a8d6c7910f7bf68f7cf9cc1964998006fa8894b/statuses" - }, - "patch": { - "href": "https://api.bitbucket.org/2.0/repositories/TestWorkspace1/testrepository1/patch/3a8d6c7910f7bf68f7cf9cc1964998006fa8894b" - } - }, - "parents": [ - { - "hash": "08b01c378b0c67999528bdb5d364d1960409cd99", - "links": { - "self": { - "href": "https://api.bitbucket.org/2.0/repositories/TestWorkspace1/testrepository1/commit/08b01c378b0c67999528bdb5d364d1960409cd99" + "links": { + "self": { + "href": "https://api.bitbucket.org/2.0/repositories/TestWorkspace1/testrepository1/commit/3a8d6c7910f7bf68f7cf9cc1964998006fa8894b" + }, + "html": { + "href": "https://bitbucket.org/TestWorkspace1/testrepository1/commits/3a8d6c7910f7bf68f7cf9cc1964998006fa8894b" + }, + "diff": { + "href": "https://api.bitbucket.org/2.0/repositories/TestWorkspace1/testrepository1/diff/3a8d6c7910f7bf68f7cf9cc1964998006fa8894b" + }, + "approve": { + "href": "https://api.bitbucket.org/2.0/repositories/TestWorkspace1/testrepository1/commit/3a8d6c7910f7bf68f7cf9cc1964998006fa8894b/approve" + }, + "comments": { + "href": "https://api.bitbucket.org/2.0/repositories/TestWorkspace1/testrepository1/commit/3a8d6c7910f7bf68f7cf9cc1964998006fa8894b/comments" + }, + "statuses": { + "href": "https://api.bitbucket.org/2.0/repositories/TestWorkspace1/testrepository1/commit/3a8d6c7910f7bf68f7cf9cc1964998006fa8894b/statuses" + }, + "patch": { + "href": "https://api.bitbucket.org/2.0/repositories/TestWorkspace1/testrepository1/patch/3a8d6c7910f7bf68f7cf9cc1964998006fa8894b" + }, + }, + "parents": [ + { + "hash": "08b01c378b0c67999528bdb5d364d1960409cd99", + "links": { + "self": { + "href": "https://api.bitbucket.org/2.0/repositories/TestWorkspace1/testrepository1/commit/08b01c378b0c67999528bdb5d364d1960409cd99" + }, + "html": { + "href": "https://bitbucket.org/TestWorkspace1/testrepository1/commits/08b01c378b0c67999528bdb5d364d1960409cd99" + }, + }, + "type": "commit", + } + ], + "repository": { + "type": "repository", + "full_name": "TestWorkspace1/testrepository1", + "links": { + "self": {"href": "https://api.bitbucket.org/2.0/repositories/TestWorkspace1/testrepository1"}, + "html": {"href": "https://bitbucket.org/TestWorkspace1/testrepository1"}, + "avatar": { + "href": "https://bytebucket.org/ravatar/%7Bc4f5c559-de42-4b98-8502-4d73ee76c393%7D?ts=default" + }, + }, + "name": "testrepository1", + "uuid": "{n789754-de42-4b98-8502-4d73ee76c393}", }, - "html": { - "href": "https://bitbucket.org/TestWorkspace1/testrepository1/commits/08b01c378b0c67999528bdb5d364d1960409cd99" - } - }, - "type": "commit" } - ], - "repository": { - "type": "repository", - "full_name": "TestWorkspace1/testrepository1", - "links": { - "self": { - "href": "https://api.bitbucket.org/2.0/repositories/TestWorkspace1/testrepository1" - }, - "html": { - "href": "https://bitbucket.org/TestWorkspace1/testrepository1" - }, - "avatar": { - "href": "https://bytebucket.org/ravatar/%7Bc4f5c559-de42-4b98-8502-4d73ee76c393%7D?ts=default" - } - }, - "name": "testrepository1", - "uuid": "{n789754-de42-4b98-8502-4d73ee76c393}" - } - } - ], - "pagelen": 10, - "page": 1 -} \ No newline at end of file + ], + "pagelen": 10, + "page": 1, +} diff --git a/tests/test_bitbucket_cloud_oo.py b/tests/test_bitbucket_cloud_oo.py index 6239724ab..2def5998f 100644 --- a/tests/test_bitbucket_cloud_oo.py +++ b/tests/test_bitbucket_cloud_oo.py @@ -272,8 +272,7 @@ def test_commits(self, tc1): assert len(pr_commits) == 1 commit_1 = pr_commits[0] assert isinstance(commit_1, Commit) - assert commit_1.message == 'src created online with Bitbucket' - + assert commit_1.message == "src created online with Bitbucket" def test_comment(self, tc1): msg = "hello world"