1
0
mirror of synced 2024-11-12 01:00:46 +01:00
bemaniutils/bemani/tests/test_APIClient.py
2021-05-31 18:14:04 +00:00

22 lines
1.2 KiB
Python

# 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'))