Skip to content

Commit

Permalink
Add file for misc tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ines committed Apr 23, 2017
1 parent 83f6694 commit 012ea59
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions spacy/tests/test_misc.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# coding: utf-8
from __future__ import unicode_literals

from ..util import ensure_path

from pathlib import Path
import pytest


@pytest.mark.parametrize('text', ['hello/world', 'hello world'])
def test_util_ensure_path_succeeds(text):
path = ensure_path(text)
assert isinstance(path, Path)


@pytest.mark.parametrize('text', [b'hello/world', True, False, None])
def test_util_ensure_path_fails(text):
path = ensure_path(text)
assert not isinstance(path, Path)

0 comments on commit 012ea59

Please sign in to comment.