Beispiel #1
0
 def test_short_string(self):
     self.assertEqual(_count_newlines_from_end(u'The quick\n'), 1)
Beispiel #2
0
 def test_multiple_newlines(self):
     self.assertEqual(_count_newlines_from_end(u'The quick brown fox jumped over the lazy dog' * 1000 + u'\n\n\n'), 3)
Beispiel #3
0
 def test_mostly_newlines(self):
     self.assertEqual(_count_newlines_from_end(u'The quick brown fox jumped over the lazy dog' + u'\n' * 1000), 1000)
Beispiel #4
0
 def test_zero_length_string(self):
     self.assertEqual(_count_newlines_from_end(u''), 0)
Beispiel #5
0
 def test_zero_newlines(self):
     self.assertEqual(_count_newlines_from_end(u'The quick brown fox jumped over the lazy dog' * 1000), 0)
Beispiel #6
0
 def test_all_newlines(self):
     self.assertEqual(_count_newlines_from_end(u'\n' * 10), 10)
 def test_short_string(self):
     self.assertEquals(_count_newlines_from_end(u'The quick\n'), 1)
 def test_one_newline(self):
     self.assertEquals(
         _count_newlines_from_end(
             u'The quick brown fox jumped over the lazy dog' * 1000 +
             u'\n'), 1)
 def test_zero_length_string(self):
     self.assertEquals(_count_newlines_from_end(u''), 0)
 def test_mostly_newlines(self):
     self.assertEquals(_count_newlines_from_end(u'The quick brown fox jumped over the lazy dog' + u'\n' * 1000), 1000)
 def test_all_newlines(self):
     self.assertEquals(_count_newlines_from_end(u'\n' * 10), 10)
 def test_zero_newlines(self):
     self.assertEquals(_count_newlines_from_end(u'The quick brown fox jumped over the lazy dog' * 1000), 0)
 def test_multiple_newlines(self):
     self.assertEquals(_count_newlines_from_end(u'The quick brown fox jumped over the lazy dog' * 1000 + u'\n\n\n'), 3)