-
-
Notifications
You must be signed in to change notification settings - Fork 249
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
802d58a
commit 3ac9422
Showing
12 changed files
with
1,081 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
"""Test blocks.""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
"""Test cases for Blocks (admonitions).""" | ||
from ... import util | ||
|
||
|
||
class TestBlocksAdmonitions(util.MdCase): | ||
"""Test Blocks admonitions cases.""" | ||
|
||
extension = ['pymdownx.blocks'] | ||
|
||
def test_optional_title(self): | ||
"""Test that tab is not processed if title is omitted.""" | ||
|
||
self.check_markdown( | ||
R''' | ||
/// admonition | ||
Some *content* | ||
/// | ||
''', | ||
r''' | ||
<div class="admonition"> | ||
<p>Some <em>content</em></p> | ||
</div> | ||
''', # noqa: E501 | ||
True | ||
) | ||
|
||
def test_type_no_title(self): | ||
"""Test test type as title.""" | ||
|
||
self.check_markdown( | ||
R''' | ||
/// admonition | ||
type: note | ||
attributes: | ||
class: other | ||
Some *content* | ||
/// | ||
''', | ||
r''' | ||
<div class="admonition note other"> | ||
<p class="admonition-title">Note</p> | ||
<p>Some <em>content</em></p> | ||
</div> | ||
''', # noqa: E501 | ||
True | ||
) | ||
|
||
def test_admonition(self): | ||
"""Test admonition with title.""" | ||
|
||
self.check_markdown( | ||
R''' | ||
/// admonition | A Title | ||
Some *content* | ||
/// | ||
''', | ||
r''' | ||
<div class="admonition"> | ||
<p class="admonition-title">A Title</p> | ||
<p>Some <em>content</em></p> | ||
</div> | ||
''', # noqa: E501 | ||
True | ||
) | ||
|
||
def test_note_no_title(self): | ||
"""Test note with no title.""" | ||
|
||
self.check_markdown( | ||
R''' | ||
/// note | ||
Some *content* | ||
/// | ||
''', | ||
r''' | ||
<div class="admonition note"> | ||
<p class="admonition-title">Note</p> | ||
<p>Some <em>content</em></p> | ||
</div> | ||
''', # noqa: E501 | ||
True | ||
) | ||
|
||
def test_note_with_title(self): | ||
"""Test note with no title.""" | ||
|
||
self.check_markdown( | ||
R''' | ||
/// note | A Title | ||
Some *content* | ||
/// | ||
''', | ||
r''' | ||
<div class="admonition note"> | ||
<p class="admonition-title">A Title</p> | ||
<p>Some <em>content</em></p> | ||
</div> | ||
''', # noqa: E501 | ||
True | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
"""Test cases for Blocks (details).""" | ||
from ... import util | ||
|
||
|
||
class TestBlocksDetails(util.MdCase): | ||
"""Test Blocks details cases.""" | ||
|
||
extension = ['pymdownx.blocks'] | ||
|
||
def test_optional_title(self): | ||
"""Test that tab is not processed if title is omitted.""" | ||
|
||
self.check_markdown( | ||
R''' | ||
/// details | ||
Some *content* | ||
/// | ||
''', | ||
r''' | ||
<details> | ||
<p>Some <em>content</em></p> | ||
</details> | ||
''', # noqa: E501 | ||
True | ||
) | ||
|
||
def test_type_no_title(self): | ||
"""Test test type as title.""" | ||
|
||
self.check_markdown( | ||
R''' | ||
/// details | ||
type: note | ||
attributes: | ||
class: other | ||
Some *content* | ||
/// | ||
''', | ||
r''' | ||
<details class="note other"> | ||
<summary>Note</summary> | ||
<p>Some <em>content</em></p> | ||
</details> | ||
''', # noqa: E501 | ||
True | ||
) | ||
|
||
def test_details(self): | ||
"""Test details with title.""" | ||
|
||
self.check_markdown( | ||
R''' | ||
/// details | A Title | ||
Some *content* | ||
/// | ||
''', | ||
r''' | ||
<details> | ||
<summary>A Title</summary> | ||
<p>Some <em>content</em></p> | ||
</details> | ||
''', # noqa: E501 | ||
True | ||
) | ||
|
||
def test_details_open(self): | ||
"""Test details forced open.""" | ||
|
||
self.check_markdown( | ||
R''' | ||
/// details | A Title | ||
open: true | ||
Some *content* | ||
/// | ||
''', | ||
r''' | ||
<details open="open"> | ||
<summary>A Title</summary> | ||
<p>Some <em>content</em></p> | ||
</details> | ||
''', # noqa: E501 | ||
True | ||
) |
Oops, something went wrong.