mirror of
https://github.com/ammaraskar/pyCraft.git
synced 2024-11-25 03:35:29 +01:00
66a0603acf
- Return value of _make_request() is treated as a requests.Request, when it is in fact a requests.Response. - Some tests in test_authentication use assertRaises() incorrectly, resulting in testing code that never gets run. - Other miscellaneous errors exposed by the above changes. Additionally: - YggdrasilError instances now have fields with specific error information, and _raise_from_response() populates them. (This will be useful for later changes.)
16 lines
439 B
Python
16 lines
439 B
Python
from minecraft.exceptions import YggdrasilError
|
|
|
|
import unittest
|
|
|
|
|
|
class RaiseYggdrasilError(unittest.TestCase):
|
|
def test_raise_yggdrasil_error(self):
|
|
with self.assertRaises(YggdrasilError):
|
|
raise YggdrasilError
|
|
|
|
def test_raise_yggdrasil_error_message(self):
|
|
with self.assertRaises(YggdrasilError) as cm:
|
|
raise YggdrasilError("Error!")
|
|
|
|
self.assertEqual(str(cm.exception), "Error!")
|