[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
a7d415262a
commit
764adf95d5
1 changed files with 6 additions and 26 deletions
|
|
@ -3058,11 +3058,7 @@ def test_model_download_records_completed_baseline_for_new_gguf_variant(monkeypa
|
|||
monkeypatch.setattr(downloads, "_registry", registry)
|
||||
monkeypatch.setattr(downloads, "_spawn_download_worker", lambda *_args, **_kwargs: _Proc())
|
||||
|
||||
asyncio.run(
|
||||
downloads.download_model_response(
|
||||
_download_body(gguf_variant = "Q4_K_M")
|
||||
)
|
||||
)
|
||||
asyncio.run(downloads.download_model_response(_download_body(gguf_variant = "Q4_K_M")))
|
||||
|
||||
assert registry.claim_kwargs["blob_hashes"] == frozenset({"mainhash"})
|
||||
assert registry.claim_kwargs["progress_blob_hashes"] == frozenset({"mainhash", "mmprojhash"})
|
||||
|
|
@ -3144,11 +3140,7 @@ def test_gguf_model_download_skips_completed_baseline_for_variant_resume_state(
|
|||
monkeypatch.setattr(downloads, "_registry", registry)
|
||||
monkeypatch.setattr(downloads, "_spawn_download_worker", lambda *_args, **_kwargs: _Proc())
|
||||
|
||||
asyncio.run(
|
||||
downloads.download_model_response(
|
||||
_download_body(gguf_variant = "Q4_K_M")
|
||||
)
|
||||
)
|
||||
asyncio.run(downloads.download_model_response(_download_body(gguf_variant = "Q4_K_M")))
|
||||
|
||||
assert registry.claim_kwargs["completed_baseline_bytes"] == 0
|
||||
|
||||
|
|
@ -3345,11 +3337,7 @@ def test_model_claim_register_cancel_uses_registry_marker_owner(monkeypatch):
|
|||
lambda proc, **_kwargs: killed.append(proc),
|
||||
)
|
||||
|
||||
result = asyncio.run(
|
||||
downloads.download_model_response(
|
||||
_download_body()
|
||||
)
|
||||
)
|
||||
result = asyncio.run(downloads.download_model_response(_download_body()))
|
||||
|
||||
assert result["state"] == "cancelled"
|
||||
assert killed
|
||||
|
|
@ -3461,11 +3449,7 @@ def test_model_download_watcher_invalidates_hf_cache_scan(monkeypatch):
|
|||
|
||||
monkeypatch.setattr(downloads.asyncio, "to_thread", _inline_to_thread)
|
||||
|
||||
result = asyncio.run(
|
||||
downloads.download_model_response(
|
||||
_download_body()
|
||||
)
|
||||
)
|
||||
result = asyncio.run(downloads.download_model_response(_download_body()))
|
||||
|
||||
assert result["accepted"] is True
|
||||
assert invalidated == [True]
|
||||
|
|
@ -3530,12 +3514,8 @@ def test_two_concurrent_same_repo_variants_both_complete(monkeypatch, tmp_path):
|
|||
|
||||
async def _run_both():
|
||||
return await asyncio.gather(
|
||||
downloads.download_model_response(
|
||||
_download_body(gguf_variant = "Q4_K_M")
|
||||
),
|
||||
downloads.download_model_response(
|
||||
_download_body(gguf_variant = "Q8_0")
|
||||
),
|
||||
downloads.download_model_response(_download_body(gguf_variant = "Q4_K_M")),
|
||||
downloads.download_model_response(_download_body(gguf_variant = "Q8_0")),
|
||||
)
|
||||
|
||||
results = asyncio.run(_run_both())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue