Skip to content

Commit cee5e93

Browse files
committed
Resolve conflicts
2 parents 4e86988 + 1832039 commit cee5e93

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

atlassian/bitbucket/cloud/common/users.py

+10
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,26 @@ def __init__(self, url, data, *args, **kwargs):
77

88
@property
99
def display_name(self):
10+
""" Display name used by Bitbucket Cloud """
1011
return str(self.get_data("display_name"))
1112

1213
@property
1314
def nickname(self):
15+
""" Username used by Bitbucket Cloud """
1416
return self.get_data("nickname")
1517

1618
@property
1719
def account_id(self):
20+
""" Account id used by Bitbucket Cloud """
1821
return self.get_data("account_id")
1922

2023
@property
2124
def uuid(self):
25+
""" User id used by Bitbucket Cloud """
2226
return self.get_data("uuid")
2327

2428

29+
2530
class Participant(BitbucketCloudBase):
2631
ROLE_REVIEWER = "REVIEWER"
2732
ROLE_PARTICIPANT = "PARTICIPANT"
@@ -63,3 +68,8 @@ def has_approved(self):
6368
def participated_on(self):
6469
"""Time of last participation."""
6570
return self.get_time("participated_on")
71+
72+
@property
73+
def avatar(self):
74+
""" URL to user avatar on Bitbucket Cloud """
75+
return self.get_data("links")["avatar"]["href"]

tests/responses/bitbucket/cloud/2.0/repositories/TestWorkspace1/testrepository1/pullrequests/1/GET

+2-6
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,7 @@ responses[None] = {
158158
"links": {
159159
"self": {"href": "users/%7BUser03UUID%7D"},
160160
"html": {"href": "https://bitbucket.org/%7BUser03UUID%7D/"},
161-
"avatar": {
162-
"href": "https://secure.gravatar.com/avatar/ad2424dafaasdssaew12232344434432?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FU3-0.png"
163-
},
161+
"avatar": {"href": "users/%7BUser03UUID%7D.png"},
164162
},
165163
"nickname": "User03Nickname",
166164
"type": "user",
@@ -241,9 +239,7 @@ responses[None] = {
241239
"links": {
242240
"self": {"href": "users/%7BUser03UUID%7D"},
243241
"html": {"href": "https://bitbucket.org/%7BUser03UUID%7D/"},
244-
"avatar": {
245-
"href": "https://secure.gravatar.com/avatar/ad2424dafaasdssaew12232344434432?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FU3-0.png"
246-
},
242+
"avatar": {"href": "users/%7BUser03UUID%7D.png"},
247243
},
248244
"nickname": "User03Nickname",
249245
"type": "user",

tests/test_bitbucket_cloud_oo.py

+4
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ def test_author(self, tc1):
223223
assert tc1.author.uuid == "{User03UUID}"
224224
assert tc1.author.account_id == "User03AccountID"
225225
assert tc1.author.nickname == "User03Nickname"
226+
assert tc1.author.avatar == "users/%7BUser03UUID%7D.png"
226227

227228
def test_participants(self, tc1):
228229
participants = list(tc1.participants())
@@ -231,10 +232,13 @@ def test_participants(self, tc1):
231232
p1 = participants[1]
232233
assert isinstance(p1, Participant)
233234
assert isinstance(p1.user, User)
235+
print(p1)
234236
assert p1.user.display_name == "User03DisplayName"
235237
assert p1.user.uuid == "{User03UUID}"
236238
assert p1.user.account_id == "User03AccountID"
237239
assert p1.user.nickname == "User03Nickname"
240+
assert p1.user.avatar == "users/%7BUser03UUID%7D.png"
241+
238242
assert _datetimetostr(p1.participated_on) == _datetimetostr(datetime(2020, 7, 9, 7, 0, 54, 416331))
239243
assert p1.is_participant
240244
assert not p1.is_reviewer

0 commit comments

Comments
 (0)