Esempio n. 1
0
 def test_long_many_strings_spaces(self):
     testvalue = 'The quick brown fox jumped over the lazy dog'
     self.assertEqual(wp2.wrap_text(testvalue, 12), ['The quick',
                                                     'brown fox',
                                                     'jumped over',
                                                     'the lazy dog'])
Esempio n. 2
0
 def test_long_one_string_spaces(self):
     testvalue = 'abc defghijklmnopq rstuvwxyzabcdefgh ij'
     self.assertEqual(wp2.wrap_text(testvalue, 10), ['abc defghi',
                                                     'jklmnopq',
                                                     'rstuvwxyza',
                                                     'bcdefgh ij'])
Esempio n. 3
0
 def test_short_string_ret_same(self):
     testvalue = 'gattaca'
     self.assertEqual(wp2.wrap_text(testvalue, 10), 'gattaca')
Esempio n. 4
0
 def test_long_string_ret_chopped(self):
     testvalue = 'abcdefghijklmnopqrstuvwxyzabcdefghij'
     self.assertEqual(wp2.wrap_text(testvalue, 10), ['abcdefghij',
                                                     'klmnopqrst',
                                                     'uvwxyzabcd',
                                                     'efghij'])
Esempio n. 5
0
 def test_empty_string_ret_empty(self):
     testvalue = ''
     self.assertEqual(wp2.wrap_text(testvalue, 10), '')