178 lines
10 KiB
Plaintext
178 lines
10 KiB
Plaintext
.................................................F...................... [ 8%]
|
|
...........F............................................................ [ 16%]
|
|
......................................F................................. [ 24%]
|
|
........................................................................ [ 32%]
|
|
........................................................................ [ 41%]
|
|
........................................................................ [ 49%]
|
|
........................................................................ [ 57%]
|
|
........................................................................ [ 65%]
|
|
........................................................................ [ 73%]
|
|
........................................................................ [ 82%]
|
|
........................................................................ [ 90%]
|
|
........................................................................ [ 98%]
|
|
..........FF. [100%]
|
|
=================================== FAILURES ===================================
|
|
__ test_every_position_refuses_even_recomputed_caller_digest[saved-0-field7] ___
|
|
|
|
i = 0
|
|
field = {'field': 'saved_position_3', 'label': '额外null保存槽(按钮候选)', 'type': '未确认前端状态', 'schema_default': '本提交JS创建Update inputs按钮,服务端无此参数', ...}
|
|
variant = 'saved'
|
|
|
|
@pytest.mark.parametrize("i,field", FIELDS)
|
|
@pytest.mark.parametrize("variant", ["saved", "type", "text"])
|
|
def test_every_position_refuses_even_recomputed_caller_digest(i, field, variant):
|
|
s, r = copy.deepcopy(SOURCES[i]), copy.deepcopy(REVIEWS[i])
|
|
b = r["fixed_version_document"]
|
|
f = next(f for f in b["fields"] if f["pointer"] == field["pointer"])
|
|
if variant == "text":
|
|
f["schema_default"] = "forged"
|
|
else:
|
|
parent, _, key = field["pointer"].rpartition("/")
|
|
target = pointer(s, parent)
|
|
target[int(key) if isinstance(target, list) else key] = (
|
|
"forged" if variant == "type" else None
|
|
)
|
|
f["value"] = pointer(s, field["pointer"])
|
|
f["json_type"] = type(f["value"]).__name__
|
|
b["canonical_sha256"] = hashlib.sha256(canonical(s)).hexdigest()
|
|
r["caller_digest"] = hashlib.sha256(canonical(b)).hexdigest()
|
|
> assert not doc(i, s, r)["fixed_version"]["matched"]
|
|
E assert not True
|
|
|
|
calliope-backend/tests/test_concat_fixed_document.py:84: AssertionError
|
|
__ test_every_position_refuses_even_recomputed_caller_digest[saved-0-field41] __
|
|
|
|
i = 0
|
|
field = {'field': 'saved_position_3', 'label': '额外null保存槽(按钮候选)', 'type': '未确认前端状态', 'schema_default': '本提交JS创建Update inputs按钮,服务端无此参数', ...}
|
|
variant = 'saved'
|
|
|
|
@pytest.mark.parametrize("i,field", FIELDS)
|
|
@pytest.mark.parametrize("variant", ["saved", "type", "text"])
|
|
def test_every_position_refuses_even_recomputed_caller_digest(i, field, variant):
|
|
s, r = copy.deepcopy(SOURCES[i]), copy.deepcopy(REVIEWS[i])
|
|
b = r["fixed_version_document"]
|
|
f = next(f for f in b["fields"] if f["pointer"] == field["pointer"])
|
|
if variant == "text":
|
|
f["schema_default"] = "forged"
|
|
else:
|
|
parent, _, key = field["pointer"].rpartition("/")
|
|
target = pointer(s, parent)
|
|
target[int(key) if isinstance(target, list) else key] = (
|
|
"forged" if variant == "type" else None
|
|
)
|
|
f["value"] = pointer(s, field["pointer"])
|
|
f["json_type"] = type(f["value"]).__name__
|
|
b["canonical_sha256"] = hashlib.sha256(canonical(s)).hexdigest()
|
|
r["caller_digest"] = hashlib.sha256(canonical(b)).hexdigest()
|
|
> assert not doc(i, s, r)["fixed_version"]["matched"]
|
|
E assert not True
|
|
|
|
calliope-backend/tests/test_concat_fixed_document.py:84: AssertionError
|
|
__________ test_actual_paths_counts_old_objects_and_media_conditions ___________
|
|
|
|
def test_actual_paths_counts_old_objects_and_media_conditions():
|
|
resource = "calliope-backend/src/calliope/comfyui/source_reviews.json"
|
|
old = json.loads(subprocess.check_output(["git", "show", "d1ba226:" + resource], cwd=REPO))
|
|
now = json.loads((REPO / resource).read_bytes())
|
|
b = now[PATHS[0]].pop("fixed_version_document")
|
|
d = doc(0)
|
|
assert now == old and len(DEFINITIONS) == 21
|
|
assert d["fixed_version"]["matched"] and len(b["fields"]) == 42
|
|
assert b["comments"] == [] and b["counts"]["history_objects"] == 3
|
|
assert b["counts"]["scalar_saved_positions"] == 39
|
|
assert b["counts"]["linked_saved_fields"] == 1
|
|
assert d["status"] == dict(imported=True, doc_done=False, exec_verified=False)
|
|
assert d["dependencies"]["check_state"] == "unchecked"
|
|
assert review_for(PATHS[0], "0" * 40) is None
|
|
blocks = [r["fixed_version_document"] for r in old.values() if "fixed_version_document" in r]
|
|
assert len(blocks) == 20 and sum(len(b["fields"]) for b in blocks) == 576
|
|
> assert sum(len(b["comments"]) for b in blocks) == 15
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
calliope-backend/tests/test_concat_fixed_document.py:168:
|
|
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
|
|
|
|
.0 = <list_iterator object at 0x7fbcd99c4cd0>
|
|
|
|
> assert sum(len(b["comments"]) for b in blocks) == 15
|
|
^^^^^^^^^^^^^
|
|
E KeyError: 'comments'
|
|
|
|
calliope-backend/tests/test_concat_fixed_document.py:168: KeyError
|
|
______________ test_real_document_and_frozen_old_fourteen_blocks _______________
|
|
|
|
def test_real_document_and_frozen_old_fourteen_blocks():
|
|
d = doc()
|
|
assert d["fixed_version"]["matched"] and d["fixed_version"]["fields"] == BLOCK["fields"]
|
|
assert d["status"] == dict(imported=True, doc_done=False, exec_verified=False)
|
|
assert d["dependencies"]["check_state"] == "unchecked"
|
|
assert "fixed_version" not in doc(path="untrusted.json")
|
|
review = copy.deepcopy(REVIEW)
|
|
other = next(
|
|
p
|
|
for p in DEFINITIONS
|
|
if p != PATH and not p.endswith(("NLF_视频人物动作骨架获取.json", "/视频倒放.json"))
|
|
)
|
|
resource = "calliope-backend/src/calliope/comfyui/source_reviews.json"
|
|
now = json.loads((REPO / resource).read_bytes())
|
|
for added in [
|
|
p
|
|
for p in now
|
|
if p.endswith(
|
|
("视频转gif动图图片.json", "加载图片合成视频.json", "双图像或视频合并显示.json")
|
|
)
|
|
]:
|
|
now[added].pop("fixed_version_document")
|
|
reverse = next(p for p in now if p.endswith("/视频倒放.json"))
|
|
now[reverse].pop("fixed_version_document")
|
|
nlf = next(p for p in now if p.endswith("NLF_视频人物动作骨架获取.json"))
|
|
now[nlf].pop("fixed_version_document")
|
|
openpose = next(p for p in now if p.endswith("openpose-video-姿态检测.json"))
|
|
> review["fixed_version_document"] = now[other]["fixed_version_document"]
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
E KeyError: 'fixed_version_document'
|
|
|
|
calliope-backend/tests/test_sdpose_fixed_document.py:173: KeyError
|
|
______ test_ten_documents_only_gain_overview_and_new_block_is_independent ______
|
|
|
|
def test_ten_documents_only_gain_overview_and_new_block_is_independent():
|
|
p = "calliope-backend/src/calliope/comfyui/source_reviews.json"
|
|
old = json.loads(subprocess.check_output(["git", "show", "ec3388a:" + p], cwd=REPO))
|
|
now = json.loads((REPO / p).read_bytes())
|
|
# Freeze the historical eleven-document revision; the two grid additions are
|
|
# independently compared against 27e6d56 in test_grid_fixed_document.
|
|
# Gemma is separately checked against 9dac1b4 in test_gemma_fixed_document.
|
|
additions = [
|
|
p
|
|
for p in DEFINITIONS
|
|
if p.endswith(
|
|
(
|
|
"图像合并成四宫格.json",
|
|
"图像分割-多宫格分割.json",
|
|
"gemma4_提示词反推(图像视频音频).json",
|
|
"sdpose_视频人物姿势骨架提取.json",
|
|
"openpose-video-姿态检测.json",
|
|
"NLF_视频人物动作骨架获取.json",
|
|
"/视频倒放.json",
|
|
"视频转gif动图图片.json",
|
|
"加载图片合成视频.json",
|
|
)
|
|
)
|
|
]
|
|
assert len(additions) == 9
|
|
for p in additions:
|
|
now[p].pop("fixed_version_document")
|
|
historical = [p for p in DEFINITIONS if p not in additions]
|
|
> assert len(historical) == 11
|
|
E AssertionError: assert 12 == 11
|
|
E + where 12 = len(['example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/双图像或视频合并显示.json', 'example_ComfyUI_workflows/3-图像生成/Qwen-Im...图像视频放大/Minimax-H3提示词增强.json', 'example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/ControlNet_aux_常用样例.json', ...])
|
|
|
|
calliope-backend/tests/test_background_fixed_document.py:217: AssertionError
|
|
=========================== short test summary info ============================
|
|
FAILED calliope-backend/tests/test_concat_fixed_document.py::test_every_position_refuses_even_recomputed_caller_digest[saved-0-field7]
|
|
FAILED calliope-backend/tests/test_concat_fixed_document.py::test_every_position_refuses_even_recomputed_caller_digest[saved-0-field41]
|
|
FAILED calliope-backend/tests/test_concat_fixed_document.py::test_actual_paths_counts_old_objects_and_media_conditions
|
|
FAILED calliope-backend/tests/test_sdpose_fixed_document.py::test_real_document_and_frozen_old_fourteen_blocks
|
|
FAILED calliope-backend/tests/test_background_fixed_document.py::test_ten_documents_only_gain_overview_and_new_block_is_independent
|
|
5 failed, 872 passed, 1 warning in 6.39s
|