(self)
| 70 | |
| 71 | class TestBaseModel(unittest.TestCase): |
| 72 | def test_build_query(self): |
| 73 | model = BaseModel() |
| 74 | |
| 75 | test_cases = [ |
| 76 | ("hello", "world", "?hello=world"), |
| 77 | ("hello", "world", "?hello=world"), |
| 78 | ("hello", "세계", "?hello=%EC%84%B8%EA%B3%84"), |
| 79 | ("hello", "세계", "?hello=%EC%84%B8%EA%B3%84"), |
| 80 | ("hello", "こんにちは", "?hello=%E3%81%93%E3%82%93%E3%81%AB%E3%81%A1%E3%81%AF"), |
| 81 | ("hello", "こんにちは", "?hello=%E3%81%93%E3%82%93%E3%81%AB%E3%81%A1%E3%81%AF"), |
| 82 | ("hello", "你好", "?hello=%E4%BD%A0%E5%A5%BD"), |
| 83 | ("hello", "你好", "?hello=%E4%BD%A0%E5%A5%BD"), |
| 84 | ("hello", "مرحبا", "?hello=%D9%85%D8%B1%D8%AD%D8%A8%D8%A7"), |
| 85 | ("hello", "مرحبا", "?hello=%D9%85%D8%B1%D8%AD%D8%A8%D8%A7"), |
| 86 | ] |
| 87 | |
| 88 | for case in test_cases: |
| 89 | key, value, expect = case |
| 90 | self.assertEqual(expect, model._build_query({key: value})) |
| 91 | |
| 92 | |
| 93 | if __name__ == "__main__": |
nothing calls this directly
no test coverage detected