Skip to content

Commit 5ed51f9

Browse files
committed
수정: 공개 공시 목록과 출처의 전수 검증 복구
공개 목록을 panel의 정렬된 제목에서 만들고 실제 블록과 기간을 집계한다. 기간을 생략한 출처 조회도 모든 가용 기간의 근거를 반환한다. 은퇴한 등록부와 None 허용 목록을 없애 실제 공개 topic을 전수 조회한다. 실데이터 runner의 기본 경로 및 공백과 복합 마커 인자 전달을 수정한다. 검증: HF 삼성전자 공개 topic 본문 및 출처 136개와 관련 단위 90개 통과. 버전 및 훅과 runner 회귀 57개 통과, 운영체제 조건 1개 skip. Cinch-Understanding: a72b86d4476c74518c867aa50959c5835a95b0edf68b5cba0742b7580e29cc40 Cinch-Understanding: 8ea71b50d30816ba9445729a81fd2ff48ea970cde031db179515bf5651273df5 Cinch-Understanding: 9245f78f2f4b05f44b908177c6f24672ebc5df01498e4d1a84a384816f5c2d5d Cinch-Understanding: 51ca3f7612655e2860308ac7384dff5ea350945011f2e72fcd0563d6e525929e Cinch-Understanding: c7752da23ba99505d92efefd953b37736ed49bff0a9f191fe2896a8b675e8093 Cinch-Understanding: 5dd88a5000835e3340db891b49869af329c8ba4282c94903290ec5dde137cb87 Cinch-Understanding: e65486ea904639371ddd9b67651ce7bd3613d9a8e662438fd0d107a954da46a7 Cinch-Understanding: cd61277270afaa8c6110cea7eee56b20dd30b65047640304823cfb401907dd3a Cinch-Understanding: 45626a5ececfe25799dee8e79526c8d8b56cfc30767d597bf5eb95c94de75314 Cinch-Understanding: c60d516d79bc4450da39bafff943402d47286f01caa844c18b2df2178d7e4561 Cinch-Understanding: b1fcddae4e4d3ac076357bb5a48cccbef691e6588494520369e3b3918276d2d0 Cinch-Understanding: 0cae2747c5b501a339101f65931ba50b93b1e41b34f464c62f3d71b5aa98d972 Cinch-Work: 9ad63dd6-8d61-4a1a-b9cd-94fd0e20f050 Cinch-Assignment: 731e7dc0-d295-4fb6-9112-5edd33700b43 Cinch-Run: 8a4b9bbd-cdb0-4bfb-8a1b-5edab38b2453
1 parent 4dfe6a2 commit 5ed51f9

9 files changed

Lines changed: 194 additions & 110 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111

1212
- **패치 버전 강제.** 실제 PyPI 발행 버전에서 다음 patch 한 단계만 허용한다. 커밋, push, 배포가 같은 검사기를 실행하며, 일반 릴리즈 요청으로 minor나 major를 올릴 수 없다.
1313
- **전체 검증 누락 차단.** Git 훅을 `.githooks`로 통일하고 push 전에 정식 preflight를 실행한다. 전체 tier 실행은 모든 실제 데이터 shard를 검사하며, 실패나 실행 계획을 통과로 표시하지 않는다. 배포는 CI Full과 Nightly 검증을 모두 기다린다.
14+
- **공시 목록과 근거 조회 정합성.** `Company.topics`가 실제 panel과 같은 정렬된 제목을 사용하고 블록·기간 수를 집계한다. 기간을 생략한 `trace()`도 공시 근거를 반환한다. 빈 내부 등록부 때문에 건너뛰던 topic 검사를 공개 목록의 본문·출처 전수 조회로 바꾸고, 실데이터 실행기의 기본 경로와 인자 전달을 수정했다.
1415
- **검증 산출물 격리.** 로컬 preflight의 임시 smoke 결과가 작업 중인 결과 파일을 덮어쓰지 않게 했다.
1516
- **Windows 검증 인코딩.** 하위 Python에도 UTF-8 설정을 전달해 한글 훅 출력을 CP949로 해독하다가 테스트가 실패하는 문제를 수정했다.
1617
- **변이 검증 실행 문맥.** 패키지와 pytest 플러그인 누락을 수정하고 존재하는 표적과 동작 테스트를 명시했다. 고정 smoke 점수를 전체 변이 검증 점수로 표현하지 않는다.

‎src/dartlab/providers/dart/accessor/profileAccessor.py‎

Lines changed: 29 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ def trace(self, topic: str, period: str | None = None) -> pl.DataFrame | dict[st
417417
418418
Capabilities:
419419
- facts (long) 에서 topic 별 row 추출 → source 별 group_by + priority max.
420-
- panel text wide row 추가 ("panel-text:topic:period" payload).
420+
- 공개 panel과 같은 정렬된 행을 추적 ("panel-text:topic:period" payload).
421421
- period 명시 시 ``rawPeriod`` 정규화 후 filter.
422422
- 출처 list 를 (priority, source) 내림차순 정렬 → primary + fallback 분리.
423423
- 출처 1 개 이상 있으면 dict, 없으면 None.
@@ -473,9 +473,9 @@ def trace(self, topic: str, period: str | None = None) -> pl.DataFrame | dict[st
473473
"""
474474
from dartlab.providers.dart.sectionPeriod import rawPeriod
475475

476-
requestedPeriod = rawPeriod(period) if isinstance(period, str) else period
476+
requestedPeriod = rawPeriod(period.strip().replace("-Q", "Q")) if isinstance(period, str) else period
477477
facts = self.facts
478-
docsSections = self._company._panelTextWide()
478+
docsSections = self._company.panel
479479

480480
sources: list[dict[str, Any]] = []
481481

@@ -494,22 +494,34 @@ def trace(self, topic: str, period: str | None = None) -> pl.DataFrame | dict[st
494494
)
495495
sources.extend(grouped.iter_rows(named=True))
496496

497-
if docsSections is not None and topic in docsSections["topic"].to_list():
498-
row = docsSections.filter(pl.col("topic") == topic)
497+
topicCol = "sectionLeaf" if docsSections is not None and "sectionLeaf" in docsSections.columns else "topic"
498+
if docsSections is not None and topicCol in docsSections.columns:
499+
row = docsSections.filter(pl.col(topicCol) == topic)
499500
if not row.is_empty():
500501
periodCols = [c for c in docsSections.columns if _isPeriodColumn(c)]
501-
if requestedPeriod is not None and requestedPeriod in periodCols:
502-
value = row.item(0, requestedPeriod)
503-
if value is not None:
504-
sources.append(
505-
{
506-
"source": "panel",
507-
"rows": 1,
508-
"payloadRef": f"panel-text:{topic}:{requestedPeriod}",
509-
"summary": str(value)[:400],
510-
"priority": 100,
511-
}
512-
)
502+
selectedPeriods = sorted(
503+
[col for col in periodCols if requestedPeriod is None or rawPeriod(col) == requestedPeriod],
504+
reverse=True,
505+
)
506+
panelSource: dict[str, Any] | None = None
507+
for selectedPeriod in selectedPeriods:
508+
values = row[selectedPeriod].drop_nulls()
509+
values = values.filter(values != "")
510+
if values.is_empty():
511+
continue
512+
if panelSource is None:
513+
panelSource = {
514+
"source": "panel",
515+
"rows": 0,
516+
"payloadRef": f"panel-text:{topic}:{selectedPeriod}",
517+
"summary": str(values[0])[:400],
518+
"priority": 100,
519+
"periods": [],
520+
}
521+
panelSource["rows"] += len(values)
522+
panelSource["periods"].append(selectedPeriod)
523+
if panelSource is not None:
524+
sources.append(panelSource)
513525

514526
if not sources:
515527
return None

‎src/dartlab/providers/dart/company.py‎

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -395,12 +395,11 @@ def rebuildModuleRegistry() -> None:
395395
}
396396

397397
_CHAPTER_ORDER: dict[str, int] = {chapter: idx for idx, chapter in enumerate(_CHAPTER_TITLES, start=1)}
398-
_TOPIC_META_COLUMNS = frozenset({"chapter", "sectionLeaf", "blockLeaf", "topic", "source", "disclosureKey", "scope"})
399398
_FINANCE_TOPICS = ("BS", "IS", "CIS", "CF", "SCE", "ratios")
400399

401400

402401
def _buildPanelTopicRows(textWide: pl.DataFrame | None) -> tuple[list[dict[str, Any]], set[str]]:
403-
"""panel text wide에서 topic 요약 행과 중복 방지 집합을 만든다."""
402+
"""사용자가 조회하는 panel wide에서 topic과 실제 가용 기간을 집계한다."""
404403
rows: list[dict[str, Any]] = []
405404
seen: set[str] = set()
406405
if textWide is None or textWide.is_empty():
@@ -410,8 +409,13 @@ def _buildPanelTopicRows(textWide: pl.DataFrame | None) -> tuple[list[dict[str,
410409
if topicCol is None:
411410
return rows, seen
412411

413-
periodCols = [name for name in textWide.columns if name not in _TOPIC_META_COLUMNS]
414-
for row in textWide.iter_rows(named=True):
412+
periodCols = [name for name in textWide.columns if _isPeriodColumn(name)]
413+
grouped = textWide.group_by(topicCol, maintain_order=True).agg(
414+
pl.col("chapter").first() if "chapter" in textWide.columns else pl.lit("").alias("chapter"),
415+
pl.len().alias("blocks"),
416+
*[(pl.col(period).is_not_null() & (pl.col(period) != "")).any().alias(period) for period in periodCols],
417+
)
418+
for row in grouped.iter_rows(named=True):
415419
topic = row.get(topicCol)
416420
if not isinstance(topic, str) or not topic.strip() or topic in seen:
417421
continue
@@ -423,9 +427,9 @@ def _buildPanelTopicRows(textWide: pl.DataFrame | None) -> tuple[list[dict[str,
423427
"chapter": chapterRaw.split(".", 1)[0].split()[0] if chapterRaw else "",
424428
"topic": topic,
425429
"source": "panel",
426-
"blocks": 1,
427-
"periods": sum(1 for period in periodCols if row.get(period) not in (None, "")),
428-
"latestPeriod": None,
430+
"blocks": row["blocks"],
431+
"periods": sum(bool(row[period]) for period in periodCols),
432+
"latestPeriod": max((period for period in periodCols if row[period]), default=None),
429433
}
430434
)
431435
return rows, seen
@@ -3687,8 +3691,8 @@ def topics(self) -> pl.DataFrame:
36873691
if cacheHit:
36883692
return cached
36893693

3690-
# panel topic catalog - panel text wide 에서 유도 (docs topicManifest 은퇴).
3691-
rows, seen = _buildPanelTopicRows(self._panelTextWide())
3694+
# 조회와 같은 정렬 후 이름을 사용한다. 정렬 전 옛 제목은 panel(key)로 찾을 수 없다.
3695+
rows, seen = _buildPanelTopicRows(self.panel)
36923696
combined = rows + _buildFinanceTopicRows(
36933697
self.stockCode,
36943698
available=self._hasFinanceParquet,

‎tests/POLICY.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ tests/
9494
- 2+ 엔진 cross-cutting → 최상단 또는 `tests/integration/` (별도 폴더 생성 시 본 SSOT 갱신)
9595
- 메타 검증 (audit/ast/docstring) → `tests/audit/`
9696
- 회귀 baseline 시나리오 → `tests/realData/`
97+
- 공개 topic 전수 검사는 현재 `Company.topics`에서 대상을 얻는다. 빈 등록부의 자동 skip은 전수 검증 근거가 아니다. 데이터가 있는데 공개 목록이 비면 실패하며, 각 topic의 본문과 출처를 실제로 조회한다.
9798
- private (운영자 internal) → `tests/_{name}/` (언더스코어 prefix)
9899

99100
`__init__.py` 는 basename 충돌 방지용 (같은 이름 `test_engine.py` 가 여러 폴더에 존재 → pytest rootdir 해석 충돌). 신규 폴더 생성 시 **빈 `__init__.py` 필수**.

‎tests/audit/test_realdataRunner.py‎

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
"""실데이터 실행기가 현재 tests 위치와 인자 경계를 유지하는지 검증한다."""
2+
3+
from __future__ import annotations
4+
5+
import os
6+
import shutil
7+
import subprocess
8+
from pathlib import Path
9+
10+
import pytest
11+
12+
pytestmark = pytest.mark.unit
13+
REPO_ROOT = Path(__file__).resolve().parents[2]
14+
15+
16+
@pytest.mark.parametrize("markerArgs", [[], ["-m", "realData and not network"]])
17+
def testDefaultRunnerFindsEveryFileAndPreservesMarkerArguments(tmp_path, markerArgs):
18+
bash = "C:/Program Files/Git/bin/bash.exe" if os.name == "nt" else shutil.which("bash")
19+
assert bash, "실데이터 실행에 필요한 bash가 없습니다"
20+
repo = tmp_path / "project with spaces"
21+
tests = repo / "tests"
22+
realData = tests / "realData"
23+
realData.mkdir(parents=True)
24+
runner = tests / "test-realdata.sh"
25+
shutil.copyfile(REPO_ROOT / "tests/test-realdata.sh", runner)
26+
for name in ("test_first.py", "test_second.py"):
27+
(realData / name).write_text("", encoding="utf-8")
28+
(tests / "test-lock.sh").write_text(
29+
'#!/usr/bin/env bash\n[ -f "$1" ] || exit 73\nprintf "%s\\0" "$@" >> "$DARTLAB_RUNNER_RECORD"\n',
30+
encoding="utf-8",
31+
)
32+
record = tmp_path / "calls.bin"
33+
result = subprocess.run(
34+
[bash, runner.as_posix(), *markerArgs],
35+
cwd=tmp_path,
36+
env={**os.environ, "DARTLAB_RUNNER_RECORD": record.as_posix()},
37+
capture_output=True,
38+
text=True,
39+
encoding="utf-8",
40+
check=False,
41+
)
42+
assert result.returncode == 0, result.stdout + result.stderr
43+
calls = record.read_bytes().decode().split("\0")[:-1]
44+
assert calls == [
45+
part
46+
for name in ("test_first.py", "test_second.py")
47+
for part in (f"tests/realData/{name}", *(markerArgs or ["-m", "realData"]), "-v", "--tb=short")
48+
]
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,35 @@
11
"""providers/dart/accessor/profileAccessor.py mirror smoke — P6."""
22

3+
from types import SimpleNamespace
4+
5+
import polars as pl
36
import pytest
47

58
pytestmark = pytest.mark.unit
69

710

811
def test_imports():
912
import dartlab.providers.dart.accessor.profileAccessor # noqa: F401
13+
14+
15+
@pytest.mark.parametrize("period, expectedPeriods", [(None, ["2025Q4", "2024Q4"]), ("2024-Q4", ["2024Q4"])])
16+
def testTracePanelUsesAllPopulatedRows(monkeypatch, period, expectedPeriods):
17+
from dartlab.providers.dart.accessor.profileAccessor import _ProfileAccessor
18+
19+
panel = pl.DataFrame(
20+
{
21+
"sectionLeaf": ["사업의 내용", "사업의 내용", "다른 항목"],
22+
"2025Q4": [None, "최신 본문", "무관"],
23+
"2024Q4": ["과거 본문", "", None],
24+
}
25+
)
26+
monkeypatch.setattr(_ProfileAccessor, "facts", property(lambda self: None))
27+
accessor = _ProfileAccessor(SimpleNamespace(panel=panel))
28+
result = accessor.trace("사업의 내용", period=period)
29+
assert result["primarySource"] == "panel"
30+
assert result["fallbackSources"] == []
31+
assert result["availableSources"][0]["periods"] == expectedPeriods
32+
assert result["availableSources"][0]["rows"] == len(expectedPeriods)
33+
assert result["selectedPayloadRef"] == f"panel-text:사업의 내용:{expectedPeriods[0]}"
34+
assert accessor.trace("사업의 내용", period="2023Q4") is None
35+
assert accessor.trace("없는 topic") is None

‎tests/providers/dart/test_company.py‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,34 @@
66
pytestmark = pytest.mark.unit
77

88

9+
def testTopicsUsePublicPanelAndAggregateCoverage():
10+
from types import SimpleNamespace
11+
12+
from dartlab.providers.dart.company import Company
13+
14+
panel = pl.DataFrame(
15+
{
16+
"sectionLeaf": ["최신 제목", "최신 제목"],
17+
"chapter": ["II. 사업의 내용", "II. 사업의 내용"],
18+
"leafType": ["text", "table"],
19+
"2024Q4": ["과거 본문", None],
20+
"2025Q4": [None, "최신 본문"],
21+
}
22+
)
23+
company = SimpleNamespace(panel=panel, _cache={}, _hasFinanceParquet=False, stockCode="005930")
24+
catalog = Company.topics.fget(company)
25+
assert catalog.height == 1
26+
assert catalog.row(0, named=True) == {
27+
"order": 0,
28+
"chapter": "II",
29+
"topic": "최신 제목",
30+
"source": "panel",
31+
"blocks": 2,
32+
"periods": 2,
33+
"latestPeriod": "2025Q4",
34+
}
35+
36+
937
def test_imports():
1038
try:
1139
import dartlab.providers.dart.company # noqa: F401
Lines changed: 37 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1,97 +1,56 @@
1-
"""Company.panel(topic) 전수 스모크 — registry 등록된 모든 topic 을 iterate.
2-
3-
core/registry 는 37개+ topic 을 자동 등록한다. 이 파일은 매 topic 을
4-
`c.panel(topic)` 으로 호출해 크래시/silent-None 을 잡는다.
5-
6-
과거 회귀: topic/panel 표면이 silent None → 후속 .columns 접근 크래시.
7-
"""
1+
"""공개 Company.topics에 표시된 모든 topic의 본문과 출처를 실제로 조회한다."""
82

93
from __future__ import annotations
104

11-
import pytest
5+
import gc
126

7+
import polars as pl
8+
import pytest
139

14-
def _allTopics() -> list[str]:
15-
"""registry 에서 자동 수집된 모든 topic 이름."""
16-
from dartlab.providers.dart.company import _getModuleEntries
10+
from tests.conftest import SAMSUNG, _has_data
1711

18-
return sorted({e.funcName for e in _getModuleEntries()})
12+
MISSING_DATA = "__missing_samsung_panel__"
1913

2014

21-
ALL_TOPICS = _allTopics()
15+
def _publicTopics() -> list[str]:
16+
"""은퇴한 내부 함수 등록부 대신 사용자가 보는 데이터 지도를 따른다."""
17+
if not _has_data(SAMSUNG, "panel"):
18+
return [MISSING_DATA]
19+
from dartlab import Company
2220

21+
company = Company(SAMSUNG)
22+
try:
23+
catalog = company.topics
24+
assert isinstance(catalog, pl.DataFrame) and "topic" in catalog.columns
25+
topics = sorted(set(catalog["topic"].drop_nulls().to_list()))
26+
assert topics, "Company.topics가 비어 있어 전수 검사를 실행할 수 없습니다"
27+
return topics
28+
finally:
29+
del company
30+
gc.collect()
2331

24-
# 데이터 부재 시 None/빈 DataFrame 이 허용되는 topic.
25-
# 비상장 성격/소규모 회사에서는 특정 공시 파트가 비어있을 수 있음.
26-
_TOPIC_NONE_ALLOWED: frozenset[str] = frozenset(
27-
{
28-
"bond", # 채무증권 발행 이력 없을 수 있음
29-
"sanction", # 제재 이력 없을 수 있음
30-
"contingentLiability", # 우발부채 없을 수 있음
31-
"fundraising", # 증자감자 이벤트 없을 수 있음
32-
"investmentInOther", # 타법인 출자 없을 수 있음
33-
"riskDerivative", # 파생상품 없을 수 있음
34-
"relatedPartyTx", # 관계자 거래 없을 수 있음
35-
"affiliate", # 관계기업 투자 없을 수 있음
36-
"executivePay", # 임원보수 공시 안한 경우
37-
"dividend", # 무배당 회사
38-
"otherFinance", # 기타 재무 없음 가능
39-
# fixture 한계로 None 허용 (로컬 실데이터에서는 데이터 존재)
40-
"business", # 사업의내용 — fixture panel 데이터 한계
41-
"companyOverviewDetail", # 회사개요 상세 — 동일
42-
}
43-
)
4432

45-
# 2026-04-21 Phase D: show() 가 registered-but-empty topic 을 ValueError 대신 None
46-
# 으로 리턴하도록 수정 → 해당 frozenset 비움 (xfail 불필요).
47-
_SHOW_ROUTING_KNOWN_ISSUES: frozenset[str] = frozenset()
33+
PUBLIC_TOPICS = _publicTopics()
4834

4935

5036
@pytest.mark.realData
5137
@pytest.mark.integration
52-
@pytest.mark.parametrize("topic", ALL_TOPICS)
53-
def test_show_topicNoSilentFail(samsungRealData, topic):
54-
"""c.panel(topic) 이 각 topic 에서 크래시하지 않고, None 은 허용 topic 에서만."""
55-
try:
56-
result = samsungRealData.panel(topic)
57-
except NotImplementedError:
58-
pytest.skip(f"show({topic}) 미구현")
59-
except ValueError as e:
60-
if topic in _SHOW_ROUTING_KNOWN_ISSUES and "찾을 수 없습니다" in str(e):
61-
pytest.xfail(f"show({topic!r}) 기존 라우팅 버그 — registry 등록됐으나 show() 가 ValueError")
62-
pytest.fail(f"show({topic!r}) 크래시: {type(e).__name__}: {e}")
63-
except Exception as e:
64-
pytest.fail(f"show({topic!r}) 크래시: {type(e).__name__}: {e}")
65-
66-
if result is None:
67-
if topic in _TOPIC_NONE_ALLOWED:
68-
return
69-
pytest.fail(
70-
f"show({topic!r}) None — 화이트리스트에 없음. "
71-
f"삼성전자는 충분히 큰 회사여서 빈 topic 이 의심스럽다. "
72-
f"정말 데이터 없음이 정상이면 _TOPIC_NONE_ALLOWED 에 추가."
73-
)
38+
@pytest.mark.parametrize("topic", PUBLIC_TOPICS)
39+
def testPanelPublicTopicReturnsData(samsungRealData, topic):
40+
"""공개 목록에 있는 topic은 실제 읽을 수 있는 본문을 반환해야 한다."""
41+
assert topic != MISSING_DATA, "samsungRealData의 데이터 부재 가드가 실행되지 않았습니다"
42+
result = samsungRealData.panel(topic)
43+
assert isinstance(result, pl.DataFrame), f"panel({topic!r}) 본문 없음: {type(result).__name__}"
44+
assert not result.is_empty(), f"panel({topic!r}) 빈 본문"
7445

7546

7647
@pytest.mark.realData
7748
@pytest.mark.integration
78-
@pytest.mark.parametrize("topic", ALL_TOPICS)
79-
def test_trace_topicNoSilentFail(samsungRealData, topic):
80-
"""c.trace(topic) — 데이터 출처 추적. show 쌍둥이 커버."""
81-
try:
82-
result = samsungRealData.trace(topic)
83-
except NotImplementedError:
84-
pytest.skip(f"trace({topic}) 미구현")
85-
except Exception as e:
86-
pytest.fail(f"trace({topic!r}) 크래시: {type(e).__name__}: {e}")
87-
88-
# fixture 환경에서는 trace 데이터가 제한적이므로 None 허용 폭을 관대하게.
89-
# 로컬 실데이터 환경에서만 엄격 검증.
90-
import os
91-
92-
inFixtureEnv = "fixtures" in os.environ.get("DARTLAB_DATA_DIR", "")
93-
if inFixtureEnv:
94-
return
95-
# 로컬: show 기반 핵심 topic 만 엄격 검증
96-
if result is None and topic in {"sections", "business", "mdna", "rnd"}:
97-
pytest.fail(f"trace({topic!r}) None — 핵심 topic 에서 trace 실종")
49+
@pytest.mark.parametrize("topic", PUBLIC_TOPICS)
50+
def testTracePublicTopicHasSource(samsungRealData, topic):
51+
"""본문이 광고된 topic은 fixture 환경에서도 실제 출처를 제시해야 한다."""
52+
assert topic != MISSING_DATA, "samsungRealData의 데이터 부재 가드가 실행되지 않았습니다"
53+
result = samsungRealData.trace(topic)
54+
assert isinstance(result, dict), f"trace({topic!r}) 출처 없음"
55+
assert result.get("primarySource"), f"trace({topic!r}) primarySource 없음"
56+
assert result.get("availableSources"), f"trace({topic!r}) availableSources 없음"

0 commit comments

Comments
 (0)