Example #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)
Example #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)
Example #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)
Example #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)
Example #5
0
def test_format_translation(before, expected):
    result = format_translation(before)
    assert result == expected
Example #6
0
def test_format_translation(before, expected):
    result = format_translation(before)
    assert result == expected