Ejemplo n.º 1
0
 def test_short_string(self):
     self.assertEqual(_count_newlines_from_end(u'The quick\n'), 1)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 4
0
 def test_zero_length_string(self):
     self.assertEqual(_count_newlines_from_end(u''), 0)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 8
0
 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)