source: products/quintagroup.seoptimizer/trunk/quintagroup/seoptimizer/tests/testUtils.py @ 3189

Last change on this file since 3189 was 3189, checked in by vmaksymiv, 8 years ago

added unescaping functionality

File size: 1.0 KB
Line 
1from unittest import TestSuite, makeSuite, TestCase
2from quintagroup.seoptimizer.util import unescape
3
4
5class TestUtils(TestCase):
6
7    def test_unicode_str_unescaping(self):
8        self.assertEqual(unescape(u"&&-/["), u"&&-/[")
9
10    def test_str_unescaping(self):
11        self.assertEqual(unescape("&&-/["), u"&&-/[")
12
13    def test_hex_unescaping(self):
14        self.assertEqual(unescape('['), u'[')
15
16    def test_simple_text_unescaping(self):
17        self.assertEqual(unescape("Simple text."), u"Simple text.")
18
19    def test_entity_hex_unescaping(self):
20        self.assertEqual(unescape('['), u'[')
21
22    def test_intity_dec_unescaping(self):
23        self.assertEqual(unescape('['), u'[')
24
25    def test_entity_dec_hex_unescaping(self):
26        self.assertEqual(unescape('['), u'[')
27
28    def test_fake_entity_unescaping(self):
29        self.assertEqual(unescape("&asd;"), u"&asd;")
30
31
32def test_suite():
33    suite = TestSuite()
34    suite.addTest(makeSuite(TestUtils))
35    return suite
Note: See TracBrowser for help on using the repository browser.