File: test_html_helper.py

package info (click to toggle)
python-bottle 0.13.2-1.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,540 kB
  • sloc: python: 6,417; makefile: 70; sh: 30
file content (23 lines) | stat: -rw-r--r-- 707 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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.assertEqual(_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!!!', {})]
        )