Exemplo n.º 1
0
    def test_accept_wellformed_must_validate(self):
        match = ACCEPT.match('text/plain')

        self.assertNotEqual(
            match, None,
            "ACCEPT wellformed must validate"
        )
Exemplo n.º 2
0
    def test_accept_without_subtype_must_not_validate(self):
        match = ACCEPT.match('text')

        self.assertEqual(
            match, None,
            "ACCEPT without subtype must not validate"
        )
Exemplo n.º 3
0
    def test_accept_without_semicolon_must_not_validate(self):
        match = ACCEPT.match('text/x-dvi q=0.8')

        self.assertEqual(
            match, None,
            "ACCEPT without semicolon must not be valid"
        )
Exemplo n.º 4
0
    def test_empty_accept_must_not_validate(self):
        match = ACCEPT.match('')

        self.assertEqual(
            match, None,
            "ACCEPT must not validate if it is empty"
        )
Exemplo n.º 5
0
 def test_accept_must_validate_with_plus_symbols(self):
     match = ACCEPT.match('text/xhtml+xml')
     
     self.assertNotEqual(
         match, None,
         "ACCEPT must validate with plus symbols"
     )
Exemplo n.º 6
0
 def test_accept_multiple_types(self):
     match = ACCEPT.match('text/plain; q=0.8, xml/plain')
     
     self.assertNotEqual(
         match, None,
         "ACCEPT must validate with multiple types"
     )