from markdown.test_tools import TestCase
class TestHorizontalRules(TestCase):
def test_hr_asterisks(self):
self.assertMarkdownRenders(
'***',
'
'
)
def test_hr_asterisks_spaces(self):
self.assertMarkdownRenders(
'* * *',
'
'
)
def test_hr_asterisks_long(self):
self.assertMarkdownRenders(
'*******',
'
'
)
def test_hr_asterisks_spaces_long(self):
self.assertMarkdownRenders(
'* * * * * * *',
'
'
)
def test_hr_asterisks_1_indent(self):
self.assertMarkdownRenders(
' ***',
'
'
)
def test_hr_asterisks_spaces_1_indent(self):
self.assertMarkdownRenders(
' * * *',
'
'
)
def test_hr_asterisks_2_indent(self):
self.assertMarkdownRenders(
' ***',
'
'
)
def test_hr_asterisks_spaces_2_indent(self):
self.assertMarkdownRenders(
' * * *',
'
'
)
def test_hr_asterisks_3_indent(self):
self.assertMarkdownRenders(
' ***',
'
'
)
def test_hr_asterisks_spaces_3_indent(self):
self.assertMarkdownRenders(
' * * *',
'
'
)
def test_hr_asterisks_trailing_space(self):
self.assertMarkdownRenders(
'*** ',
'
'
)
def test_hr_asterisks_spaces_trailing_space(self):
self.assertMarkdownRenders(
'* * * ',
'
'
)
def test_hr_hyphens(self):
self.assertMarkdownRenders(
'---',
'
'
)
def test_hr_hyphens_spaces(self):
self.assertMarkdownRenders(
'- - -',
'
'
)
def test_hr_hyphens_long(self):
self.assertMarkdownRenders(
'-------',
'
'
)
def test_hr_hyphens_spaces_long(self):
self.assertMarkdownRenders(
'- - - - - - -',
'
'
)
def test_hr_hyphens_1_indent(self):
self.assertMarkdownRenders(
' ---',
'
'
)
def test_hr_hyphens_spaces_1_indent(self):
self.assertMarkdownRenders(
' - - -',
'
'
)
def test_hr_hyphens_2_indent(self):
self.assertMarkdownRenders(
' ---',
'
'
)
def test_hr_hyphens_spaces_2_indent(self):
self.assertMarkdownRenders(
' - - -',
'
'
)
def test_hr_hyphens_3_indent(self):
self.assertMarkdownRenders(
' ---',
'
'
)
def test_hr_hyphens_spaces_3_indent(self):
self.assertMarkdownRenders(
' - - -',
'
'
)
def test_hr_hyphens_trailing_space(self):
self.assertMarkdownRenders(
'--- ',
'
'
)
def test_hr_hyphens_spaces_trailing_space(self):
self.assertMarkdownRenders(
'- - - ',
'
'
)
def test_hr_underscores(self):
self.assertMarkdownRenders(
'___',
'
'
)
def test_hr_underscores_spaces(self):
self.assertMarkdownRenders(
'_ _ _',
'
'
)
def test_hr_underscores_long(self):
self.assertMarkdownRenders(
'_______',
'
'
)
def test_hr_underscores_spaces_long(self):
self.assertMarkdownRenders(
'_ _ _ _ _ _ _',
'
'
)
def test_hr_underscores_1_indent(self):
self.assertMarkdownRenders(
' ___',
'
'
)
def test_hr_underscores_spaces_1_indent(self):
self.assertMarkdownRenders(
' _ _ _',
'
'
)
def test_hr_underscores_2_indent(self):
self.assertMarkdownRenders(
' ___',
'
'
)
def test_hr_underscores_spaces_2_indent(self):
self.assertMarkdownRenders(
' _ _ _',
'
'
)
def test_hr_underscores_3_indent(self):
self.assertMarkdownRenders(
' ___',
'
'
)
def test_hr_underscores_spaces_3_indent(self):
self.assertMarkdownRenders(
' _ _ _',
'
'
)
def test_hr_underscores_trailing_space(self):
self.assertMarkdownRenders(
'___ ',
'
'
)
def test_hr_underscores_spaces_trailing_space(self):
self.assertMarkdownRenders(
'_ _ _ ',
'
'
)
def test_hr_before_paragraph(self):
self.assertMarkdownRenders(
self.dedent(
"""
***
An HR followed by a paragraph with no blank line.
"""
),
self.dedent(
"""
An HR followed by a paragraph with no blank line.
"""
)
)
def test_hr_after_paragraph(self):
self.assertMarkdownRenders(
self.dedent(
"""
A paragraph followed by an HR with no blank line.
***
"""
),
self.dedent(
"""
A paragraph followed by an HR with no blank line.
"""
)
)
def test_not_hr_2_asterisks(self):
self.assertMarkdownRenders(
'**',
'**
'
)
def test_not_hr_2_asterisks_spaces(self):
self.assertMarkdownRenders(
'* *',
self.dedent(
"""
"""
)
)
def test_not_hr_2_hyphens(self):
self.assertMarkdownRenders(
'--',
'--
'
)
def test_not_hr_2_hyphens_spaces(self):
self.assertMarkdownRenders(
'- -',
self.dedent(
"""
"""
)
)
def test_not_hr_2_underscores(self):
self.assertMarkdownRenders(
'__',
'__
'
)
def test_not_hr_2_underscores_spaces(self):
self.assertMarkdownRenders(
'_ _',
'_ _
'
)