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

23 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"))