This commit is contained in:
ManishMadan2882
2025-10-01 02:23:53 +05:30
parent aab8d3a4f1
commit 7d8ed2d102
11 changed files with 12 additions and 17 deletions

View File

@@ -2,17 +2,19 @@ from pathlib import Path
from unittest.mock import mock_open, patch
import pytest
import tiktoken
from application.parser.file.markdown_parser import MarkdownParser
class _Enc:
def encode(self, s: str):
return list(s)
@pytest.fixture(autouse=True)
def _patch_tokenizer(monkeypatch):
import application.parser.file.markdown_parser as mdp
monkeypatch.setattr(mdp.tiktoken, "get_encoding", lambda _: _Enc())
from application.parser.file.markdown_parser import MarkdownParser
monkeypatch.setattr(tiktoken, "get_encoding", lambda _: _Enc())
def test_markdown_init_parser():
parser = MarkdownParser()