Initial commit
This commit is contained in:
22
venv/lib/python3.7/site-packages/nltk/test/unit/test_data.py
Normal file
22
venv/lib/python3.7/site-packages/nltk/test/unit/test_data.py
Normal file
@@ -0,0 +1,22 @@
|
||||
import unittest
|
||||
import nltk.data
|
||||
from nose.tools import assert_raises
|
||||
|
||||
|
||||
class TestData(unittest.TestCase):
|
||||
def test_find_raises_exception(self):
|
||||
|
||||
with assert_raises(LookupError) as context:
|
||||
nltk.data.find('no_such_resource/foo')
|
||||
|
||||
assert type(context.exception) == LookupError, 'Unexpected exception raised'
|
||||
|
||||
def test_find_raises_exception_with_full_resource_name(self):
|
||||
no_such_thing = 'no_such_thing/bar'
|
||||
|
||||
with assert_raises(LookupError) as context:
|
||||
nltk.data.find(no_such_thing)
|
||||
|
||||
assert no_such_thing in str(
|
||||
context.exception
|
||||
), 'Exception message does not include full resource name'
|
||||
Reference in New Issue
Block a user