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