Exemple #1
0
 def test_format_translation(self):
     cases = (('', ''), ('{^in^}', '\cxds in\cxds '), ('{pre^}',
                                                       'pre\cxds '),
              ('{pre^} ', 'pre\cxds '), ('{pre^}  ', 'pre\cxds '))
     for before, expected in cases:
         result = format_translation(before)
         msg = 'format_translation(%r) != %r: %r' % (before, expected,
                                                     result)
         self.assertEqual(result, expected, msg=msg)
Exemple #2
0
 def test_format_translation(self):
     cases = (
     ('', ''),
     ('{^in^}', '\cxds in\cxds '),
     ('{pre^}', 'pre\cxds '),
     ('{pre^} ', 'pre\cxds '),
     ('{pre^}  ', 'pre\cxds ')
     )
     for before, expected in cases:
         result = format_translation(before)
         msg = 'format_translation(%r) != %r: %r' % (
             before, expected, result
         )
         self.assertEqual(result, expected, msg=msg)
Exemple #3
0
    def test_format_translation(self):
        cases = (('', ''), ('{^in^}', '\cxds in\cxds '), ('{pre^}',
                                                          'pre\cxds '),
                 ('{pre^} ', 'pre\cxds '), ('{pre^}  ', 'pre\cxds '))

        failed = False
        format_str = "format({}) != {}: {}"
        for before, expected in cases:
            result = format_translation(before)
            if result != expected:
                failed = True
                print format_str.format(before, expected, result)

        self.assertFalse(failed)
Exemple #4
0
 def test_format_translation(self):
     cases = (
     ('', ''),
     ('{^in^}', '\cxds in\cxds '),
     ('{pre^}', 'pre\cxds '),
     ('{pre^} ', 'pre\cxds '),
     ('{pre^}  ', 'pre\cxds ')
     )
     
     failed = False
     format_str = "format({}) != {}: {}"
     for before, expected in cases:
         result = format_translation(before)
         if result != expected:
             failed = True
             print format_str.format(before, expected, result)
         
     self.assertFalse(failed)
def test_format_translation(before, expected):
    result = format_translation(before)
    assert result == expected
Exemple #6
0
def test_format_translation(before, expected):
    result = format_translation(before)
    assert result == expected