mirror of
https://github.com/Dinnerbone/mcstatus.git
synced 2026-04-06 12:01:24 +08:00
Support favicon
This commit is contained in:
@@ -136,3 +136,6 @@ class PingResponse:
|
||||
if "description" not in raw:
|
||||
raise ValueError("Invalid status object (no 'description' value)")
|
||||
self.description = raw["description"]
|
||||
|
||||
if "favicon" in raw:
|
||||
self.favicon = raw["favicon"]
|
||||
@@ -84,6 +84,10 @@ class TestPingResponse(TestCase):
|
||||
def test_players_missing(self):
|
||||
self.assertRaises(ValueError, PingResponse, {"description":"A Minecraft Server","version":{"name":"1.8-pre1","protocol":44}})
|
||||
|
||||
def test_favicon(self):
|
||||
response = PingResponse({"description":"A Minecraft Server","players":{"max":20,"online":0},"version":{"name":"1.8-pre1","protocol":44},"favicon":"data:image/png;base64,foo"})
|
||||
|
||||
self.assertEqual(response.favicon, "data:image/png;base64,foo")
|
||||
|
||||
class TestPingResponsePlayers(TestCase):
|
||||
def test_invalid(self):
|
||||
|
||||
Reference in New Issue
Block a user