Skip to content

Commit

Permalink
Merge pull request #4 from ickc/better-test
Browse files Browse the repository at this point in the history
Better test
  • Loading branch information
ickc committed Jan 13, 2017
2 parents ed21461 + cb247ea commit a92e8f5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
3 changes: 0 additions & 3 deletions .gitignore
Expand Up @@ -23,6 +23,3 @@ htmlcov/

# rst2html
README.html

# generated pickle
*.pkl
4 changes: 1 addition & 3 deletions makefile
Expand Up @@ -98,14 +98,12 @@ init:
pip install -r requirements.txt
pip install -r tests/requirements.txt

pytest: $(testNative) tests/tables.pkl tests/test_idempotent.native
pytest: $(testNative) tests/test_idempotent.native
python3 -m pytest -vv --cov=pantable tests
pytest2: $(testNative) tests/tables.pkl tests/test_idempotent.native
python2 -m pytest -vv --cov=pantable tests
pytestLite:
python3 -m pytest -vv --cov=pantable tests
%.pkl: %.md
pandoc -F tests/to_pkl.py $< > /dev/null
tests/reference_idempotent.native: tests/test_pantable.md
pandoc --normalize -t native -F pantable/pantable.py -F pantable/pantable2csv.py -F pantable/pantable.py -F pantable/pantable2csv.py -o $@ $<
tests/test_idempotent.native: tests/reference_idempotent.native
Expand Down
12 changes: 8 additions & 4 deletions tests/pantable2csv/test_table2csv.py
Expand Up @@ -8,10 +8,14 @@

def test_table2csv():
# get_table_body
with open('tests/grid_tables.pkl', 'rb') as file:
doc = pickle.load(file)
elem = doc.content[0]
code_block = table2csv(elem, {})
markdown = """| 1 | 2 | 3 | 4 |
|:--|--:|:-:|---|
| 1 | 2 | 3 | 4 |
: *abcd*
"""
Panflute = convert_text(markdown)
code_block = table2csv(*Panflute, {})
assert str(code_block) == '''CodeBlock(---
alignment: LRCD
caption: '*abcd*'
Expand Down

0 comments on commit a92e8f5

Please sign in to comment.