def test_title_in_context(self):
     """Check that a title is formatted correctly when surrounded
        by other text"""
     output = Output()
     output.line("test1")
     output.title("ab")
     output.line("test2")
     self.assertEquals(str(output), "test1\nab\n--\ntest2")
 def test_title(self):
     """Check that a title is written and underlined with the
        same number of underline characters as text to underline"""
     output = Output()
     output.title("a")
     self.assertEquals(str(output), "a\n-")