Fix the GGUF variant contract test against the merged handler signature
The assertion pinned the exact single-line call handleVariantClick(v.quant, v.downloaded, expectedBytes, v.filename), but the handler takes (quant, filename, downloaded, sizeBytes) and prettier wraps the call across lines, so the mandatory repository test job failed on every push. Match the call structurally and assert the filename really is forwarded in the handler's argument order.
This commit is contained in:
parent
64e2b173b8
commit
273755ab42
1 changed files with 6 additions and 2 deletions
|
|
@ -588,8 +588,12 @@ def test_variant_expander_forwards_the_gguf_filename():
|
|||
handler = re.search(r"const handleVariantClick = useCallback\(.*?\n \);", src, re.S)
|
||||
assert handler, "handleVariantClick not found"
|
||||
assert "ggufFilename: filename," in handler.group(0)
|
||||
# The call site has to actually pass it through.
|
||||
assert "handleVariantClick(v.quant, v.downloaded, expectedBytes, v.filename)" in src
|
||||
# The call site has to actually pass it through, in the handler's argument order.
|
||||
# Matched structurally: prettier wraps the call across lines once it grows.
|
||||
call = re.search(r"handleVariantClick\(([^)]*)\)", src)
|
||||
assert call, "handleVariantClick call site not found"
|
||||
args = [a.strip() for a in call.group(1).split(",") if a.strip()]
|
||||
assert args[:2] == ["v.quant", "v.filename"], args
|
||||
|
||||
|
||||
def test_diffusion_pages_never_drop_a_gguf_pick_silently():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue