mirror of
https://github.com/explosion/spaCy.git
synced 2025-01-13 18:56:36 +03:00
Add test for #1868: Vocab.__contains__ with ints
This commit is contained in:
parent
43f381ce36
commit
42a18ef903
13
spacy/tests/regression/test_issue1868.py
Normal file
13
spacy/tests/regression/test_issue1868.py
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
'''Test Vocab.__contains__ works with int keys'''
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
from ... vocab import Vocab
|
||||||
|
|
||||||
|
def test_issue1868():
|
||||||
|
vocab = Vocab()
|
||||||
|
lex = vocab['hello']
|
||||||
|
assert lex.orth in vocab
|
||||||
|
assert lex.orth_ in vocab
|
||||||
|
assert 'some string' not in vocab
|
||||||
|
int_id = vocab.strings.add('some string')
|
||||||
|
assert int_id not in vocab
|
Loading…
Reference in New Issue
Block a user