Example #1
0
    def test_truncate(self):
        s = "foo"
        s_truncated = truncate(s)
        self.assertEqual(s, s_truncated)

        many_lines = "\n".join(map(lambda x: "line %d" % x, [l for l in range(500)]))
        less_lines = truncate(many_lines)

        self.assertTrue("lines suppressed" in less_lines)
Example #2
0
    def test_truncate(self):
        s = "foo"
        s_truncated = truncate(s)
        self.assertEqual(s, s_truncated)

        many_lines = "\n".join(map(lambda x: "line %d" % x, [l for l in range(500)]))
        less_lines = truncate(many_lines)

        self.assertTrue("lines suppressed" in less_lines)
Example #3
0
 def test_no_truncate(self):
     text = 'arst'
     self.assertEqual(truncate(text), text)
Example #4
0
 def test_trunctate(self):
     text = 'a\na\na\na\na\na\na\na\na\na\na\na \
             \na\na\na\na\na\na\na\na\na\na\na \
             \na\na\na\na\na\na\na\na\na\na'
     self.assertNotEqual(truncate(text), text)
Example #5
0
 def test_no_truncate(self):
     text = 'arst'
     self.assertEqual(truncate(text), text)
Example #6
0
    def test_trunctate(self):
        text = 'a\na\na\na\na\na\na\na\na\na\na\na \
                \na\na\na\na\na\na\na\na\na\na\na \
                \na\na\na\na\na\na\na\na\na\na'

        self.assertNotEqual(truncate(text), text)