Example #1
0
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)
Example #2
0
def test_write_underline_single():
    """happy path"""
    assert util.write_underline("h") == "-"
Example #3
0
def test_write_underline_empty():
    """empty"""
    assert util.write_underline("") == ""
Example #4
0
def test_write_underline():
    """happy path"""
    assert util.write_underline("1234") == "----"
Example #5
0
 def test_write_underline_single(self):
     """happy path"""
     self.assertEqual(util.write_underline("h"), "-")
Example #6
0
 def test_write_underline_empty(self):
     """empty"""
     self.assertEqual(util.write_underline(""), "")
Example #7
0
 def test_write_underline(self):
     """happy path"""
     self.assertEqual(util.write_underline("1234"), "----")