-
Notifications
You must be signed in to change notification settings - Fork 391
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
Marc Wouts
committed
Jul 5, 2018
1 parent
4e43c80
commit 46d6a82
Showing
2 changed files
with
22 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# coding: utf-8 | ||
import nbrmd | ||
import pytest | ||
from .utils import list_all_notebooks | ||
|
||
|
||
@pytest.mark.parametrize('nb_file', list_all_notebooks('.ipynb') + | ||
list_all_notebooks('.Rmd')) | ||
def test_notebook_contents_is_unicode(nb_file): | ||
nb = nbrmd.readf(nb_file) | ||
|
||
for cell in nb.cells: | ||
assert cell.source == '' or isinstance(cell.source, unicode) | ||
|
||
|
||
def test_write_non_ascii(tmpdir): | ||
nb = nbrmd.reads(u'Non-ascii contênt') | ||
nbrmd.writef(nb, str(tmpdir.join('notebook.Rmd'))) | ||
nbrmd.writef(nb, str(tmpdir.join('notebook.ipynb'))) |