def test_html_compatibility_mode_no_xhtml(self): """ Test if the HTML retro-compatibility mode work as expected (without allowing XHTML-like tags). """ with self.assertRaises(ValueError): parse_tag('[tagname/]', 0, opening_tag_ch='[', closing_tag_ch=']', allow_self_closing_tags=False)
def test_error(self): """ Error handling tests. """ for text, excepted_exception in self.FAIL_TESTS: with self.assertRaises(excepted_exception, msg=text): parse_tag(text, 0, opening_tag_ch='[', closing_tag_ch=']')
def test_html_compatibility_mode(self): """ Test if the HTML retro-compatibility mode work as expected. """ with self.assertRaises(ValueError): parse_tag('[tagname=tagvalue]', 0, opening_tag_ch='[', closing_tag_ch=']', allow_tagvalue_attr=False)
def test_functional(self): """ Functional tests. """ for text, excepted_result in self.PASS_TESTS: result = parse_tag(text, 0, opening_tag_ch='[', closing_tag_ch=']') self.assertEqual(result, excepted_result, msg=text)