Exemple #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)
Exemple #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)
Exemple #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)
Exemple #4
0
 def test_crazy(self):
     self.assertEqual(
         cu_format_int(1234567890123).replace('\xa0', ' '),
         '҂҂҂҂а҃ ҂҂҂сл҃д ҂҂фѯ҃з ҂ѿч҃ рк҃г')
     self.assertEqual(
         cu_format_int(1234567890123, dialect='old').replace('\xa0', ' '),
         '҂҂҂҂а҃ ҂҂҂сл҃д ҂҂фѯ҃з ҂ѿ҂чрк҃г')
Exemple #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)
Exemple #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)
Exemple #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)
Exemple #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)
Exemple #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)
Exemple #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'), '҂а҃҂і')
Exemple #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'), '҂а҃҂і')
Exemple #12
0
 def test_negative(self):
     self.assertEqual(cu_format_int(-1010), '-҂а҃і')
     self.assertEqual(cu_format_int(-1010, dialect='old'), '-҂а҃і')
Exemple #13
0
 def test_no_titlo(self):
     self.assertEqual(
         cu_format_int(11100, add_titlo=False).replace('\xa0', ' '),
         '҂аі р')
Exemple #14
0
 def test_no_titlo(self):
     self.assertEqual(cu_format_int(11100, add_titlo=False).replace('\xa0', ' '), '҂аі р')
Exemple #15
0
 def test_negative(self):
     self.assertEqual(cu_format_int(-1010), '-҂а҃і')
     self.assertEqual(cu_format_int(-1010, dialect='old'), '-҂а҃і')
Exemple #16
0
 def test_crazy(self):
     self.assertEqual(cu_format_int(1234567890123).replace('\xa0', ' '), '҂҂҂҂а҃ ҂҂҂сл҃д ҂҂фѯ҃з ҂ѿч҃ рк҃г')
     self.assertEqual(cu_format_int(1234567890123, dialect='old').replace('\xa0', ' '), '҂҂҂҂а҃ ҂҂҂сл҃д ҂҂фѯ҃з ҂ѿ҂чрк҃г')
Exemple #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)
Exemple #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)