Example #1
0
    def test_all_upto_10000_dialect_old(self):

        for i in range(10000):
            j = cu_parse_int(cu_format_int(i, dialect='old'))
            self.assertEqual(i, j)
            j = cu_parse_int(cu_format_int(i, add_titlo=False, dialect='old'))
            self.assertEqual(i, j)
Example #2
0
    def test_all_upto_10000(self):

        for i in range(10000):
            j = cu_parse_int(cu_format_int(i))
            self.assertEqual(i, j)
            j = cu_parse_int(cu_format_int(i, add_titlo=False))
            self.assertEqual(i, j)
Example #3
0
    def test_all_upto_10000(self):

        for i in range(10000):
            j = cu_parse_int(cu_format_int(i))
            self.assertEqual(i, j)
            j = cu_parse_int(cu_format_int(i, add_titlo=False))
            self.assertEqual(i, j)
Example #4
0
 def test_crazy(self):
     self.assertEqual(
         cu_format_int(1234567890123).replace('\xa0', ' '),
         '҂҂҂҂а҃ ҂҂҂сл҃д ҂҂фѯ҃з ҂ѿч҃ рк҃г')
     self.assertEqual(
         cu_format_int(1234567890123, dialect='old').replace('\xa0', ' '),
         '҂҂҂҂а҃ ҂҂҂сл҃д ҂҂фѯ҃з ҂ѿ҂чрк҃г')
Example #5
0
    def test_all_upto_10000_dialect_old(self):

        for i in range(10000):
            j = cu_parse_int(cu_format_int(i, dialect='old'))
            self.assertEqual(i, j)
            j = cu_parse_int(cu_format_int(i, add_titlo=False, dialect='old'))
            self.assertEqual(i, j)
Example #6
0
    def test_random_dialect_old(self):

        for _ in range(10000):
            i = random.randint(10000, 10000000)
            j = cu_parse_int(cu_format_int(i, dialect='old'))
            self.assertEqual(i, j)
            j = cu_parse_int(cu_format_int(i, add_titlo=False, dialect='old'))
            self.assertEqual(i, j)
Example #7
0
    def test_random(self):

        for _ in range(10000):
            i = random.randint(10000, 10000000)
            j = cu_parse_int(cu_format_int(i))
            self.assertEqual(i, j)
            j = cu_parse_int(cu_format_int(i, add_titlo=False))
            self.assertEqual(i, j)
Example #8
0
    def test_random(self):

        for _ in range(10000):
            i = random.randint(10000, 10000000)
            j = cu_parse_int(cu_format_int(i))
            self.assertEqual(i, j)
            j = cu_parse_int(cu_format_int(i, add_titlo=False))
            self.assertEqual(i, j)
Example #9
0
    def test_random_dialect_old(self):

        for _ in range(10000):
            i = random.randint(10000, 10000000)
            j = cu_parse_int(cu_format_int(i, dialect='old'))
            self.assertEqual(i, j)
            j = cu_parse_int(cu_format_int(i, add_titlo=False, dialect='old'))
            self.assertEqual(i, j)
Example #10
0
    def test_other(self):
        self.assertNotEqual(cu_format_int(1010), cu_format_int(11000))

        self.assertEqual(cu_format_int(1010), '҂а҃і')
        self.assertEqual(cu_format_int(11000), '҂а҃҂і')

        self.assertEqual(cu_format_int(1010, dialect='old'), '҂а҃і')
        self.assertEqual(cu_format_int(11000, dialect='old'), '҂а҃҂і')
Example #11
0
    def test_other(self):
        self.assertNotEqual(cu_format_int(1010), cu_format_int(11000))

        self.assertEqual(cu_format_int(1010), '҂а҃і')
        self.assertEqual(cu_format_int(11000), '҂а҃҂і')

        self.assertEqual(cu_format_int(1010, dialect='old'), '҂а҃і')
        self.assertEqual(cu_format_int(11000, dialect='old'), '҂а҃҂і')
Example #12
0
 def test_negative(self):
     self.assertEqual(cu_format_int(-1010), '-҂а҃і')
     self.assertEqual(cu_format_int(-1010, dialect='old'), '-҂а҃і')
Example #13
0
 def test_no_titlo(self):
     self.assertEqual(
         cu_format_int(11100, add_titlo=False).replace('\xa0', ' '),
         '҂аі р')
Example #14
0
 def test_no_titlo(self):
     self.assertEqual(cu_format_int(11100, add_titlo=False).replace('\xa0', ' '), '҂аі р')
Example #15
0
 def test_negative(self):
     self.assertEqual(cu_format_int(-1010), '-҂а҃і')
     self.assertEqual(cu_format_int(-1010, dialect='old'), '-҂а҃і')
Example #16
0
 def test_crazy(self):
     self.assertEqual(cu_format_int(1234567890123).replace('\xa0', ' '), '҂҂҂҂а҃ ҂҂҂сл҃д ҂҂фѯ҃з ҂ѿч҃ рк҃г')
     self.assertEqual(cu_format_int(1234567890123, dialect='old').replace('\xa0', ' '), '҂҂҂҂а҃ ҂҂҂сл҃д ҂҂фѯ҃з ҂ѿ҂чрк҃г')
Example #17
0
 def assert_good(self, num, string, dialect='standard'):
     self.assertEqual(
         cu_format_int(num, dialect=dialect).replace('\xa0', ' '), string)
     self.assertEqual(cu_parse_int(string), num)
Example #18
0
 def assert_good(self, num, string, dialect='standard'):
     self.assertEqual(cu_format_int(num, dialect=dialect).replace('\xa0', ' '), string)
     self.assertEqual(cu_parse_int(string), num)