Skip to content

Commit

Permalink
Jupytext tests work on non-English locales
Browse files Browse the repository at this point in the history
  • Loading branch information
mwouts committed Oct 1, 2020
1 parent 0b6477a commit adc28c3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
**Fixed**
- Optional dependency on `sphinx-gallery` frozen to version `~=0.7.0` (#614)
- Codecov/patch reports should be OK now (#639)
- Jupytext tests work on non-English locales (#636)


1.6.0 (2020-09-01)
Expand Down
16 changes: 11 additions & 5 deletions tests/test_contentsmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -1706,11 +1706,17 @@ def test_new_untitled(tmpdir):
cm = jupytext.TextFileContentsManager()
cm.root_dir = str(tmpdir)

assert cm.new_untitled(type="notebook")["path"] == "Untitled.ipynb"
assert cm.new_untitled(type="notebook", ext=".md")["path"] == "Untitled1.md"
assert cm.new_untitled(type="notebook", ext=".py")["path"] == "Untitled2.py"
assert cm.new_untitled(type="notebook")["path"] == "Untitled3.ipynb"
assert cm.new_untitled(type="notebook", ext=".py:percent")["path"] == "Untitled4.py"
# untitled is "Untitled" only when the locale is English #636
untitled, ext = cm.new_untitled(type="notebook")["path"].split(".")
assert untitled
assert ext == "ipynb"

assert cm.new_untitled(type="notebook", ext=".md")["path"] == untitled + "1.md"
assert cm.new_untitled(type="notebook", ext=".py")["path"] == untitled + "2.py"
assert cm.new_untitled(type="notebook")["path"] == untitled + "3.ipynb"
assert (
cm.new_untitled(type="notebook", ext=".py:percent")["path"] == untitled + "4.py"
)


def test_nested_prefix(tmpdir):
Expand Down

0 comments on commit adc28c3

Please sign in to comment.