mirror of
https://github.com/status-im/PyGithub.git
synced 2026-09-02 03:41:08 +00:00
Change type of GitRelease.author to NamedUser (#969)
Github's release object in the API response contains an `author` field having a value much more like a `NamedUser` but not `GitAuthor`. e.g. https://api.github.com/repos/edhollandAL/PyGithub/releases/1210902 ``` { "id": 1210902, "author": { "login": "edhollandAL", "id": 11922660, "node_id": "MDQ6VXNlcjExOTIyNjYw", "avatar_url": "https://avatars1.githubusercontent.com/u/11922660?v=4", "gravatar_id": "", "url": "https://api.github.com/users/edhollandAL", "html_url": "https://github.com/edhollandAL", "followers_url": "https://api.github.com/users/edhollandAL/followers", "following_url": "https://api.github.com/users/edhollandAL/following{/other_user}", "gists_url": "https://api.github.com/users/edhollandAL/gists{/gist_id}", "starred_url": "https://api.github.com/users/edhollandAL/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/edhollandAL/subscriptions", "organizations_url": "https://api.github.com/users/edhollandAL/orgs", "repos_url": "https://api.github.com/users/edhollandAL/repos", "events_url": "https://api.github.com/users/edhollandAL/events{/privacy}", "received_events_url": "https://api.github.com/users/edhollandAL/received_events", "type": "User", "site_admin": false }, // (ignored) } ```
This commit is contained in:
@@ -73,6 +73,9 @@ class Release(Framework.TestCase):
|
||||
self.assertEqual(self.release.prerelease, False)
|
||||
self.assertEqual(self.release.url, "https://api.github.com/repos/edhollandAL/PyGithub/releases/1210814")
|
||||
self.assertEqual(self.release.author._rawData['login'], "edhollandAL")
|
||||
self.assertEqual(self.release.author.login, "edhollandAL")
|
||||
self.assertEqual(self.release.author.id, 11922660)
|
||||
self.assertEqual(self.release.author.type, "User")
|
||||
self.assertEqual(self.release.html_url, "https://github.com/edhollandAL/PyGithub/releases/tag/v1.25.2")
|
||||
self.assertEqual(self.release.created_at, datetime.datetime(2014, 10, 8, 1, 54))
|
||||
self.assertEqual(self.release.published_at, datetime.datetime(2015, 4, 24, 8, 36, 51))
|
||||
|
||||
Reference in New Issue
Block a user