1
0
mirror of synced 2024-11-24 14:30:11 +01:00
bemaniutils/bemani/tests/test_APIClient.py

22 lines
1.2 KiB
Python
Raw Normal View History

# vim: set fileencoding=utf-8
import unittest
from bemani.data.api.client import APIClient
class TestAPIClient(unittest.TestCase):
def test_content_type(self) -> None:
client = APIClient('https://127.0.0.1', 'token', False, False)
self.assertFalse(client._content_type_valid('application/text'))
self.assertFalse(client._content_type_valid('application/json'))
self.assertFalse(client._content_type_valid('application/json; charset=shift-jis'))
self.assertTrue(client._content_type_valid('application/json; charset=utf-8'))
self.assertTrue(client._content_type_valid('application/json;charset=utf-8'))
self.assertTrue(client._content_type_valid('application/json;charset = utf-8'))
self.assertTrue(client._content_type_valid('application/json; charset = utf-8'))
self.assertTrue(client._content_type_valid('application/json; charset=UTF-8'))
self.assertTrue(client._content_type_valid('application/json;charset=UTF-8'))
self.assertTrue(client._content_type_valid('application/json;charset = UTF-8'))
self.assertTrue(client._content_type_valid('application/json; charset = UTF-8'))