def get_title(unique_reasons, top_n_worst): """generate the report title""" title_end = "" if unique_reasons: title_end = "uniquely bad" else: title_end = "worst" title = "top %i %s" % (top_n_worst, title_end) underline = util.write_underline(title) return "%s\n%s\n" % (title, underline)
def test_write_underline_single(): """happy path""" assert util.write_underline("h") == "-"
def test_write_underline_empty(): """empty""" assert util.write_underline("") == ""
def test_write_underline(): """happy path""" assert util.write_underline("1234") == "----"
def test_write_underline_single(self): """happy path""" self.assertEqual(util.write_underline("h"), "-")
def test_write_underline_empty(self): """empty""" self.assertEqual(util.write_underline(""), "")
def test_write_underline(self): """happy path""" self.assertEqual(util.write_underline("1234"), "----")