def test_un_balanced_markers_are_ignored(self): """Tests that lines must use balanced markers.""" formatter = formatters.format_headers() self.assertEqual(apply_formatter(formatter, ['==Unbalanced===']), ['==Unbalanced==='])
def test_only_markers_are_ignored(self): """Tests lines with only markers aren't affected.""" formatter = formatters.format_headers() self.assertEqual(apply_formatter(formatter, ['=' * 6]), ['=' * 6]) self.assertEqual(apply_formatter(formatter, ['=' * 7]), ['=' * 7])
def test_base_level_is_respected(self): """Tests changes to init level.""" formatter = formatters.format_headers(padding=2) self.assertEqual(apply_formatter(formatter, ['===Only 3===']), ['##### Only 3'])
def test_inner_markers_are_ignored(self): """Tests header markings are only interpreted when surrounding line.""" formatter = formatters.format_headers() self.assertEqual( apply_formatter(formatter, ['Not at =start= of text']), ['Not at =start= of text'])
def test_common_format(self): """Tests expected usage.""" formatter = formatters.format_headers() self.assertEqual( apply_formatter(formatter, ['=Level One=', '===Level Three===']), ['# Level One', '### Level Three'])