Supplement a unit test case for 'unquote_header_value'

the test case for api.urlmap

Change-Id: Iab8036b5fa7ed9d927088938b90e0219e4db08b8
This commit is contained in:
zhuyawei 2023-10-24 14:43:31 +08:00
parent b590c1a84f
commit 7c44204fb4

View File

@ -20,3 +20,15 @@ class TestUrlMap(unittest.TestCase):
def setUp(self): def setUp(self):
self.urlmap = urlmap self.urlmap = urlmap
super(TestUrlMap, self).setUp() super(TestUrlMap, self).setUp()
def test_unquote_header_value(self):
result = self.urlmap.unquote_header_value('')
self.assertEqual(result, '')
result = self.urlmap.unquote_header_value('test')
self.assertEqual(result, 'test')
result = self.urlmap.unquote_header_value('"test"')
self.assertEqual(result, 'test')
result = self.urlmap.unquote_header_value('"test')
self.assertEqual(result, '"test')
result = self.urlmap.unquote_header_value('test"')
self.assertEqual(result, 'test"')