-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Too easy! * Rewrote the __repr__ contract * Adding docs for CSVTable * Adding docs * Added more docs * Finished documenting new class * Added tests * Added docs to tests * Added empty line
- Loading branch information
Showing
5 changed files
with
121 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Python,3.11,3.10,3.9,3.8 | ||
SnakeMD >= 2.0,Yes,Yes,Yes,Yes | ||
SnakeMD 0.12 - 0.15,Yes,Yes,Yes,Yes | ||
SnakeMD < 0.12,,Yes,Yes,Yes |
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,5 @@ | ||
| Python | 3.11 | 3.10 | 3.9 | 3.8 | | ||
| ------------------- | ---- | ---- | --- | --- | | ||
| SnakeMD >= 2.0 | Yes | Yes | Yes | Yes | | ||
| SnakeMD 0.12 - 0.15 | Yes | Yes | Yes | Yes | | ||
| SnakeMD < 0.12 | | Yes | Yes | Yes | |
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,31 @@ | ||
import pytest | ||
|
||
from snakemd.templates import CSVTable | ||
|
||
|
||
def test_csv_table_type_error_none(): | ||
""" | ||
Verifies that None properly throws a TypeError. | ||
""" | ||
with pytest.raises(TypeError): | ||
CSVTable(None) | ||
|
||
|
||
def test_csv_table_file_not_found_error_empty(): | ||
""" | ||
Verifies that an empty string properly throws FileNotFoundError. | ||
""" | ||
with pytest.raises(FileNotFoundError): | ||
CSVTable("") | ||
|
||
def test_csv_table_sample_file(): | ||
""" | ||
Verifies that a sample CSV is properly converted into | ||
a Markdown table. | ||
""" | ||
table = CSVTable("tests/resources/python-support.csv") | ||
table_lines = str(table).splitlines(keepends=True) | ||
with open("tests/resources/python-support.md") as md: | ||
for actual, expected in zip(md.readlines(), table_lines): | ||
assert actual == expected | ||
|