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