Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jemerick committed Jun 12, 2019
1 parent fcfce42 commit 66cb1b4
Showing 1 changed file with 24 additions and 4 deletions.
28 changes: 24 additions & 4 deletions tests/test_platform_section_extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def test_section_with_code_snippet(self):
extensions=self.MARKDOWN_EXTENSIONS,
output_format='html5'
)
expected_output = '<p>some Android content shown</p>\n<p><code>java\nString java = "asdf";</code></p>'
expected_output = '<p>some Android content shown</p>\n<p><code>java\nString java = "asdf";</code>\n</p>'
self.assertEqual(expected_output, html)

def test_multiple_sections_with_code_snippet(self):
Expand All @@ -181,7 +181,7 @@ def test_multiple_sections_with_code_snippet(self):
extensions=self.MARKDOWN_EXTENSIONS,
output_format='html5'
)
expected_output = '<p>some Android content shown</p>\n<p><code>java\nString java = "asdf";</code></p>'
expected_output = '<p>some Android content shown</p>\n<p><code>java\nString java = "asdf";</code>\n</p>'
self.assertEqual(expected_output, html)

def test_inline_platform_section(self):
Expand Down Expand Up @@ -232,7 +232,7 @@ def test_inline_platform_section(self):
output_format='html5'
)
expected_output = '<p>This is just some inline text for the Android platform.</p>'
print(html)

self.assertEqual(expected_output, html)

def test_table_row_platform_section(self):
Expand Down Expand Up @@ -286,4 +286,24 @@ def test_table_row_platform_section(self):
)

self.assertEqual(expected_output, html)
print(html)

def test_back_to_back_platform_section_tags(self):
text = 'Back to back @![ios]iOS!@@![android]Android!@ tags!'
html = markdown.markdown(
text,
extension_configs=self.build_config_for_platform_section('iOS'),
extensions=['markdown.extensions.tables'] + self.MARKDOWN_EXTENSIONS,
output_format='html5'
)

expected_output = '<p>Back to back iOS tags!</p>'
self.assertEqual(expected_output, html)

html = markdown.markdown(
text,
extension_configs=self.build_config_for_platform_section('Android'),
extensions=['markdown.extensions.tables'] + self.MARKDOWN_EXTENSIONS,
output_format='html5'
)
expected_output = '<p>Back to back Android tags!</p>'
self.assertEqual(expected_output, html)

0 comments on commit 66cb1b4

Please sign in to comment.