mirror of
https://github.com/deepset-ai/haystack.git
synced 2025-08-29 02:46:39 +00:00
14 lines
300 B
Python
14 lines
300 B
Python
![]() |
from unittest.mock import Mock
|
||
|
import pytest
|
||
|
|
||
|
|
||
|
@pytest.fixture()
|
||
|
def mock_tokenizer():
|
||
|
"""
|
||
|
Tokenizes the string by splitting on spaces.
|
||
|
"""
|
||
|
tokenizer = Mock()
|
||
|
tokenizer.encode = lambda text: text.split()
|
||
|
tokenizer.decode = lambda tokens: " ".join(tokens)
|
||
|
return tokenizer
|