From 012ea594d171041a9ff064783b7c0a392a827d4c Mon Sep 17 00:00:00 2001 From: ines Date: Sun, 23 Apr 2017 21:06:46 +0200 Subject: [PATCH] Add file for misc tests --- spacy/tests/test_misc.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 spacy/tests/test_misc.py diff --git a/spacy/tests/test_misc.py b/spacy/tests/test_misc.py new file mode 100644 index 000000000..c55e587e7 --- /dev/null +++ b/spacy/tests/test_misc.py @@ -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)