Skip to content

Commit 6c3b789

Browse files
committed
1 parent 3926355 commit 6c3b789

File tree

1 file changed

+40
-44
lines changed

1 file changed

+40
-44
lines changed

src/github3/users.py

Lines changed: 40 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -309,50 +309,7 @@ class _User(models.GitHubCore):
309309

310310
def __init__(self, json, session):
311311
if json is None:
312-
# from https://api.github.com/users/ghost
313-
json = {
314-
"login": "ghost",
315-
"id": 10137,
316-
"node_id": "MDQ6VXNlcjEwMTM3",
317-
"avatar_url": "https://avatars.githubusercontent.com/u/10137?v"
318-
"=4",
319-
"gravatar_id": "",
320-
"url": "https://api.github.com/users/ghost",
321-
"html_url": "https://github.com/ghost",
322-
"followers_url": "https://api.github.com/users/ghost/followers",
323-
"following_url": "https://api.github.com/users/ghost/following"
324-
"{/other_user}",
325-
"gists_url": "https://api.github.com/users/ghost/gists{/gist_id"
326-
"}",
327-
"starred_url": "https://api.github.com/users/ghost/starred{/own"
328-
"er}{/repo}",
329-
"subscriptions_url": "https://api.github.com/users/ghost/subscr"
330-
"iptions",
331-
"organizations_url": "https://api.github.com/users/ghost/orgs",
332-
"repos_url": "https://api.github.com/users/ghost/repos",
333-
"events_url": "https://api.github.com/users/ghost/events{/priva"
334-
"cy}",
335-
"received_events_url": "https://api.github.com/users/ghost/rece"
336-
"ived_events",
337-
"type": "User",
338-
"user_view_type": "public",
339-
"site_admin": False,
340-
"name": "Deleted user",
341-
"company": None,
342-
"blog": "",
343-
"location": "Nothing to see here, move along.",
344-
"email": None,
345-
"hireable": None,
346-
"bio": "Hi, I'm @ghost! I take the place of user accounts that "
347-
"have been deleted.\n:ghost:\n",
348-
"twitter_username": None,
349-
"public_repos": 0,
350-
"public_gists": 0,
351-
"followers": 11584,
352-
"following": 0,
353-
"created_at": "2008-05-13T06:14:25Z",
354-
"updated_at": "2018-04-10T17:22:33Z",
355-
}
312+
json = _ghost_json
356313
super().__init__(json, session)
357314

358315
def _update_attributes(self, user):
@@ -1021,3 +978,42 @@ def _update_attributes(self, contributor):
1021978
UserLike = t.Union[
1022979
ShortUser, User, AuthenticatedUser, Collaborator, Contributor, str
1023980
]
981+
982+
_ghost_json: t.Final[t.Dict[str, t.Any]] = {
983+
# from https://api.github.com/users/ghost
984+
"login": "ghost",
985+
"id": 10137,
986+
"node_id": "MDQ6VXNlcjEwMTM3",
987+
"avatar_url": "https://avatars.githubusercontent.com/u/10137?v=4",
988+
"gravatar_id": "",
989+
"url": "https://api.github.com/users/ghost",
990+
"html_url": "https://github.com/ghost",
991+
"followers_url": "https://api.github.com/users/ghost/followers",
992+
"following_url": "https://api.github.com/users/ghost/following{/other_user"
993+
"}",
994+
"gists_url": "https://api.github.com/users/ghost/gists{/gist_id}",
995+
"starred_url": "https://api.github.com/users/ghost/starred{/owner}{/repo}",
996+
"subscriptions_url": "https://api.github.com/users/ghost/subscriptions",
997+
"organizations_url": "https://api.github.com/users/ghost/orgs",
998+
"repos_url": "https://api.github.com/users/ghost/repos",
999+
"events_url": "https://api.github.com/users/ghost/events{/privacy}",
1000+
"received_events_url": "https://api.github.com/users/ghost/received_events",
1001+
"type": "User",
1002+
"user_view_type": "public",
1003+
"site_admin": False,
1004+
"name": "Deleted user",
1005+
"company": None,
1006+
"blog": "",
1007+
"location": "Nothing to see here, move along.",
1008+
"email": None,
1009+
"hireable": None,
1010+
"bio": "Hi, I'm @ghost! I take the place of user accounts that have been "
1011+
"deleted.\n:ghost:\n",
1012+
"twitter_username": None,
1013+
"public_repos": 0,
1014+
"public_gists": 0,
1015+
"followers": 11584,
1016+
"following": 0,
1017+
"created_at": "2008-05-13T06:14:25Z",
1018+
"updated_at": "2018-04-10T17:22:33Z",
1019+
}

0 commit comments

Comments
 (0)