diff options
Diffstat (limited to 'test/test_html_helper.py')
-rw-r--r-- | test/test_html_helper.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/test_html_helper.py b/test/test_html_helper.py new file mode 100644 index 0000000..e4a6df5 --- /dev/null +++ b/test/test_html_helper.py @@ -0,0 +1,23 @@ +import unittest + +from bottle import _parse_http_header + + +class TestHttpUtils(unittest.TestCase): + + # TODO: Move more of the low level http stuff here. + + def test_accept_header(self): + self.assertEquals(_parse_http_header( + 'text/xml, text/whitespace ,' + 'application/params;param=value; ws = lots ;"quote"="mid\\"quote",' + '"more\\"quotes\\"",' + 'I\'m in space!!!'), + + [('text/xml', {}), + ('text/whitespace', {}), + ('application/params', {'param': 'value', 'ws': 'lots', 'quote': 'mid"quote'}), + ('more"quotes"', {}), + ('I\'m in space!!!', {})] + ) + |