feat: 가상화 문서들 추가
This commit is contained in:
@@ -123,15 +123,12 @@ class Fixture:
|
||||
self.cite(name)
|
||||
|
||||
def cite(self, name: str) -> None:
|
||||
"""그림을 Studio 자리로 복사하고 기록이 그것을 가리키게 한다 — 실제 작업 순서다."""
|
||||
studio_assets = os.path.join(self.base, "final/assets/tech-log-studio")
|
||||
os.makedirs(studio_assets, exist_ok=True)
|
||||
open(os.path.join(studio_assets, f"{name}.svg"), "w", encoding="utf-8").write("<svg/>")
|
||||
"""기록이 그림을 가리키게 한다. 사본을 만들지 않고 그림이 사는 자리를 그대로 쓴다."""
|
||||
record = os.path.join(self.studio, "session-custody/case/case-session-split.md")
|
||||
open(record, "w", encoding="utf-8").write(RECORD.replace(
|
||||
"status: 게시 전\n",
|
||||
f"status: 게시 전\nassets:\n - key: {name}\n"
|
||||
f" file: ../../../final/assets/tech-log-studio/{name}.svg\n"))
|
||||
f" file: ../../../final/assets/{name}/{name}.svg\n"))
|
||||
|
||||
def __enter__(self):
|
||||
self._saved = (verifier.ROOT, builder.ROOT, layout.ROOT)
|
||||
@@ -396,12 +393,33 @@ class LayoutTest(unittest.TestCase):
|
||||
fx.diagram("hand-drawn", with_source=False)
|
||||
self.assertIn("techviz 정본이 없는 그림", layout.verify("fixture").warns)
|
||||
|
||||
def test_studio_presentation_copies_need_no_source(self):
|
||||
def test_a_figure_that_is_really_a_table_is_counted(self):
|
||||
# 관계선이 없고 항목마다 같은 수의 details 면 표다. 표를 그림으로 그리지 않는다
|
||||
with Fixture() as fx:
|
||||
assets = os.path.join(fx.base, "final/assets/tech-log-studio")
|
||||
os.makedirs(assets)
|
||||
open(os.path.join(assets, "custody.svg"), "w", encoding="utf-8").write("<svg/>")
|
||||
self.assertEqual(layout.verify("fixture").warns, {})
|
||||
fx.diagram("distribution-choice")
|
||||
spec = os.path.join(fx.base, "final/.techviz/distribution-choice/spec.json")
|
||||
with open(spec, "w", encoding="utf-8") as fh:
|
||||
json.dump({"nodes": [{"id": "a", "details": ["형태", "선택"]},
|
||||
{"id": "b", "details": ["형태", "선택"]}],
|
||||
"edges": []}, fh)
|
||||
self.assertIn("표로 되는 그림", layout.verify("fixture").warns)
|
||||
|
||||
def test_a_figure_with_relations_is_not_a_table(self):
|
||||
with Fixture() as fx:
|
||||
fx.diagram("request-path", cited=True)
|
||||
spec = os.path.join(fx.base, "final/.techviz/request-path/spec.json")
|
||||
with open(spec, "w", encoding="utf-8") as fh:
|
||||
json.dump({"nodes": [{"id": "a", "details": ["형태"]},
|
||||
{"id": "b", "details": ["형태"]}],
|
||||
"edges": [{"from": "a", "to": "b"}]}, fh)
|
||||
self.assertNotIn("표로 되는 그림", layout.verify("fixture").warns)
|
||||
|
||||
def test_record_figure_without_a_techviz_source_is_counted(self):
|
||||
# 사본을 가리키면 그 그림은 다시 만들 수 없다. 정본이 둘이 되는 자리다
|
||||
with Fixture() as fx:
|
||||
fx.diagram("hand-drawn", with_source=False, cited=True)
|
||||
self.assertIn("기록이 가리키는 그림에 techviz 정본이 없다",
|
||||
layout.verify("fixture").warns)
|
||||
|
||||
def test_evidence_folder_outside_the_convention_is_an_error(self):
|
||||
with Fixture() as fx:
|
||||
|
||||
Reference in New Issue
Block a user