Exemple #1
0
 def test_normalizeNewlines_nothing_to_do_english(self):
     # If no newlines are found in the english text, no normalization
     # takes place.
     sanitizer = Sanitizer(u"Text without newline.")
     translation_template = u"Translation with%snewline."
     for translation_newline in self.newline_styles:
         translation_text = translation_template % translation_newline
         sanitized = sanitizer.normalizeNewlines(translation_text)
         self.assertEqual(
             translation_text, sanitized, "With %r: %r != %r" %
             (translation_newline, translation_text, sanitized))
Exemple #2
0
 def test_normalizeNewlines_nothing_to_do_translation(self):
     # If no newlines are found in the translation text, no normalization
     # takes place.
     english_template = u"Text with%snewline."
     translation_text = u"Translation without newline."
     for english_newline in self.newline_styles:
         english_text = english_template % english_newline
         sanitizer = Sanitizer(english_text)
         sanitized = sanitizer.normalizeNewlines(translation_text)
         self.assertEqual(
             translation_text, sanitized, "With %r: %r != %r" %
             (english_newline, translation_text, sanitized))
 def test_normalizeNewlines_nothing_to_do_english(self):
     # If no newlines are found in the english text, no normalization
     # takes place.
     sanitizer = Sanitizer(u"Text without newline.")
     translation_template = u"Translation with%snewline."
     for translation_newline in self.newline_styles:
         translation_text = translation_template % translation_newline
         sanitized = sanitizer.normalizeNewlines(translation_text)
         self.assertEqual(
             translation_text, sanitized,
             "With %r: %r != %r" % (
                 translation_newline, translation_text, sanitized))
 def test_normalizeNewlines_nothing_to_do_translation(self):
     # If no newlines are found in the translation text, no normalization
     # takes place.
     english_template = u"Text with%snewline."
     translation_text = u"Translation without newline."
     for english_newline in self.newline_styles:
         english_text = english_template % english_newline
         sanitizer = Sanitizer(english_text)
         sanitized = sanitizer.normalizeNewlines(translation_text)
         self.assertEqual(
             translation_text, sanitized,
             "With %r: %r != %r" % (
                 english_newline, translation_text, sanitized))
Exemple #5
0
 def test_normalizeNewlines(self):
     # Newlines will be converted to the same style that the English has.
     english_template = u"Text with%snewline."
     translation_template = u"Translation with%snewline."
     for english_newline in self.newline_styles:
         english_text = english_template % english_newline
         sanitizer = Sanitizer(english_text)
         expected_sanitized = translation_template % english_newline
         for translation_newline in self.newline_styles:
             translation_text = translation_template % translation_newline
             sanitized = sanitizer.normalizeNewlines(translation_text)
             self.assertEqual(
                 expected_sanitized, sanitized,
                 "With %r and %r:\n%r != %r" %
                 (english_newline, translation_newline, expected_sanitized,
                  sanitized))
 def test_normalizeNewlines(self):
     # Newlines will be converted to the same style that the English has.
     english_template = u"Text with%snewline."
     translation_template = u"Translation with%snewline."
     for english_newline in self.newline_styles:
         english_text = english_template % english_newline
         sanitizer = Sanitizer(english_text)
         expected_sanitized = translation_template % english_newline
         for translation_newline in self.newline_styles:
             translation_text = translation_template % translation_newline
             sanitized = sanitizer.normalizeNewlines(translation_text)
             self.assertEqual(
                 expected_sanitized, sanitized,
                 "With %r and %r:\n%r != %r" % (
                     english_newline, translation_newline,
                     expected_sanitized, sanitized))