Beispiel #1
0
 def test_same_english(self):
     self.assertFalse(self.check.check_single(
         'source',
         'source',
         Unit(code='en'),
         0
     ))
Beispiel #2
0
 def test_named_format(self):
     self.assertFalse(
         self.check.check_format(u'%1$s string', u'%1$s string',
                                 Unit('php_named_format'), 0, False))
Beispiel #3
0
 def test_no_format(self):
     self.assertFalse(
         self.check.check_format('strins', 'string', Unit('php_no_format'),
                                 0, False))
Beispiel #4
0
 def test_wrong_named_format(self):
     self.assertTrue(
         self.check.check_format(u'%(name)s string', u'%(jmeno)s string',
                                 Unit('python_wrong_named_format'), 0,
                                 False))
Beispiel #5
0
 def test_wrong_format(self):
     self.assertTrue(
         self.check.check_format(u'%s string', u'%c string',
                                 Unit('python_wrong_format'), 0, False))
Beispiel #6
0
 def test_missing_named_format_ignore(self):
     self.assertFalse(
         self.check.check_format(u'%(name)s string', u'string',
                                 Unit('python_missing_named_format'), 0,
                                 True))
Beispiel #7
0
 def test_named_format(self):
     self.assertFalse(
         self.check.check_format(u'%(name)s string', u'%(name)s string',
                                 Unit('python_named_format'), 0, False))
Beispiel #8
0
 def test_percent_format(self):
     self.assertFalse(
         self.check.check_format(u'%d%% string', u'%d%% string',
                                 Unit('python_percent_format'), 0, False))
Beispiel #9
0
 def test_wrong_named_format(self):
     self.assertTrue(
         self.check.check_format(u'%10s string', u'%20s string',
                                 Unit('c_wrong_named_format'), 0, False))
Beispiel #10
0
 def test_missing_format(self):
     self.assertTrue(
         self.check.check_format(u'%s string', u'string',
                                 Unit('c_missing_format'), 0, False))
Beispiel #11
0
 def test_format(self):
     self.assertFalse(
         self.check.check_format(u'%s string', u'%s string',
                                 Unit('c_format'), 0, False))
Beispiel #12
0
 def test_missing_named_format(self):
     self.assertTrue(
         self.check.check_format(u'%1$s string', u'string',
                                 Unit('php_missing_named_format'), 0,
                                 False))
Beispiel #13
0
 def test_failing(self):
     self.assertTrue(self.check.check_source(
         ['text...'],
         Unit(),
     ))
Beispiel #14
0
 def test_good(self):
     self.assertFalse(self.check.check_source(
         [u'text…'],
         Unit(),
     ))
Beispiel #15
0
 def test_none(self):
     self.assertFalse(self.check.check_source(
         ['text'],
         Unit(),
     ))
Beispiel #16
0
 def test_plural(self):
     self.assertFalse(self.check.check_source(
         ['text', 'texts'],
         Unit(),
     ))