mirror of
https://github.com/status-im/PyGithub.git
synced 2026-08-31 19:01:15 +00:00
Add initial version of getemojis
This commit is contained in:
@@ -359,6 +359,17 @@ class Github(object):
|
||||
)
|
||||
return GitignoreTemplate.GitignoreTemplate(self.__requester, headers, attributes, completed=True)
|
||||
|
||||
def get_emojis(self):
|
||||
"""
|
||||
:calls: `GET /emojis <http://developer.github.com/v3/emojis/>`_
|
||||
:rtype: dictionary of type => url for emoji`
|
||||
"""
|
||||
headers, attributes = self.__requester.requestJsonAndCheck(
|
||||
"GET",
|
||||
"/emojis"
|
||||
)
|
||||
return attributes
|
||||
|
||||
def create_from_raw_data(self, klass, raw_data, headers={}):
|
||||
"""
|
||||
Creates an object from raw_data previously obtained by :attr:`github.GithubObject.GithubObject.raw_data`,
|
||||
|
||||
@@ -105,6 +105,11 @@ class Github(Framework.TestCase):
|
||||
self.assertEqual(hook.events, ["push"])
|
||||
self.assertEqual(hook.schema, [["string", "url"], ["string", "token"], ["string", "project_id"], ["string", "milestone_id"], ["string", "category_id"]])
|
||||
|
||||
def testGetEmojis(self):
|
||||
emojis = self.g.get_emojis()
|
||||
first = emojis.get("+1")
|
||||
self.assertEqual(first, "https://github.global.ssl.fastly.net/images/icons/emoji/+1.png?v5")
|
||||
|
||||
def testGetHook(self):
|
||||
hook = self.g.get_hook("activecollab")
|
||||
self.assertEqual(hook.name, "activecollab")
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
https
|
||||
GET
|
||||
api.github.com
|
||||
None
|
||||
/emojis
|
||||
{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'}
|
||||
null
|
||||
200
|
||||
[('status', '200 OK'), ('content-length', '757'), ('x-github-media-type', 'github.beta; format=json'), ('x-content-type-options', 'nosniff'), ('x-ratelimit-limit', '5000'), ('x-ratelimit-remaining', '4993'), ('server', 'nginx'), ('connection', 'keep-alive'), ('etag', '"cc8e8df5d003cd489fd90931fa7f751a"'), ('cache-control', 'max-age=0, private, must-revalidate'), ('date', 'Fri, 21 Dec 2012 19:54:21 GMT'), ('content-type', 'application/json; charset=utf-8')]
|
||||
{"+1": "https://github.global.ssl.fastly.net/images/icons/emoji/+1.png?v5", "-1": "https://github.global.ssl.fastly.net/images/icons/emoji/-1.png?v5", "100": "https://github.global.ssl.fastly.net/images/icons/emoji/100.png?v5", "1234": "https://github.global.ssl.fastly.net/images/icons/emoji/1234.png?v5", "8ball": "https://github.global.ssl.fastly.net/images/icons/emoji/8ball.png?v5", "a": "https://github.global.ssl.fastly.net/images/icons/emoji/a.png?v5", "ab": "https://github.global.ssl.fastly.net/images/icons/emoji/ab.png?v5"}
|
||||
Reference in New Issue
Block a user