mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-25 17:36:30 +03:00
Add file for misc tests
This commit is contained in:
parent
83f66947dc
commit
012ea594d1
19
spacy/tests/test_misc.py
Normal file
19
spacy/tests/test_misc.py
Normal file
|
@ -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)
|
Loading…
Reference in New Issue
Block a user