def test_line_without_indent(self): lines = ["test line"] expected = [ "#############", "# test line #", ] actual = create_box_elements(lines, text_width=13) self.assertListEqual(expected, actual)
def test_empty_line_with_indent(self): lines = [" "] expected = [ " #####", " # #", ] actual = create_box_elements(lines, text_width=7) self.assertListEqual(expected, actual)
def test_commented_line(self): lines = [" # commented#"] expected = [ " ###############", " # commented #", ] actual = create_box_elements(lines, text_width=16) self.assertListEqual(expected, actual)
def test_line_with_indent(self): lines = [" some code "] expected = [ " ##############", " # some code #", ] actual = create_box_elements(lines, text_width=18) self.assertListEqual(expected, actual)
def test_long_line_wrapping(self): lines = ["This is just a line that is too long"] expected = [ "###############", "# This is just#", "# a line that #", "# is too long #", ] actual = create_box_elements(lines, text_width=15) self.assertListEqual(expected, actual)