"Fossies" - the Fresh Open Source Software Archive

Member "roundup-2.0.0/test/test_misc.py" (26 Aug 2019, 800 Bytes) of package /linux/www/roundup-2.0.0.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Python source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "test_misc.py": 1.6.1_vs_2.0.0.

    1 # misc tests
    2 
    3 import unittest
    4 import roundup.anypy.cmp_
    5 from roundup.cgi.accept_language import parse
    6 
    7 class AcceptLanguageTest(unittest.TestCase):
    8     def testParse(self):
    9         self.assertEqual(parse("da, en-gb;q=0.8, en;q=0.7"),
   10                          ['da', 'en_gb', 'en'])
   11         self.assertEqual(parse("en;q=0.2, fr;q=1"), ['fr', 'en'])
   12         self.assertEqual(parse("zn; q = 0.2 ,pt-br;q =1"), ['pt_br', 'zn'])
   13         self.assertEqual(parse("es-AR"), ['es_AR'])
   14         self.assertEqual(parse("es-es-cat"), ['es_es_cat'])
   15         self.assertEqual(parse(""), [])
   16         self.assertEqual(parse(None),[])
   17         self.assertEqual(parse("   "), [])
   18         self.assertEqual(parse("en,"), ['en'])
   19 
   20 class CmpTest(unittest.TestCase):
   21     def testCmp(self):
   22         roundup.anypy.cmp_._test()