You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
927 B
Python
32 lines
927 B
Python
"""Unit tests for parser.llm_parser_stub (LLMParserStub)."""
|
|
|
|
from __future__ import annotations
|
|
|
|
import pytest
|
|
|
|
|
|
def test_disabled_returns_none():
|
|
"""enabled=False 인 경우 parse()는 None을 반환한다."""
|
|
from libs.parser.llm_parser_stub import LLMParserStub
|
|
|
|
stub = LLMParserStub(enabled=False)
|
|
result = stub.parse(
|
|
document_id="DOC::test",
|
|
form_type="8-K",
|
|
text="Apple Inc. reports strong quarterly earnings.",
|
|
)
|
|
assert result is None
|
|
|
|
|
|
def test_enabled_raises_not_implemented():
|
|
"""enabled=True 인 경우 parse()는 NotImplementedError를 발생시킨다."""
|
|
from libs.parser.llm_parser_stub import LLMParserStub
|
|
|
|
stub = LLMParserStub(enabled=True)
|
|
with pytest.raises(NotImplementedError):
|
|
stub.parse(
|
|
document_id="DOC::test",
|
|
form_type="8-K",
|
|
text="Apple Inc. reports strong quarterly earnings.",
|
|
)
|