tests(omny): update three OMNY tests to the code merged from main
- tomo_queue_execute() resumes with tomo_scan_resume(from_queue=True) - tomo_id is a _GlobalVarParam: give the bare OMNY object a fake client - _irrelevant_params_for_type(): pass the omny profile; without it the setup-neutral fallback treats type 4 as an angle file (flomni/lamni) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
89ba28550c
commit
7c8b2a50ad
3 files changed
+11
-4
No files matched your search
@@ -196,11 +196,17 @@ def test_irrelevant_params_for_type_keeps_zero_deg_reference_for_omny_types_4_an
|
||||
"""_irrelevant_params_for_type() used to hardcode `tomo_type != 1`, which
|
||||
would hide zero_deg_reference_at_each_subtomo from an OMNY type-4/5 job's
|
||||
tooltip even though it's a real, applicable setting for those types too
|
||||
(only flomni/lamni are limited to type 1) -- fixed to `not in (1, 4, 5)`."""
|
||||
(only flomni/lamni are limited to type 1) -- the sub-tomogram types now
|
||||
come from the omny profile's "tomo_types"."""
|
||||
profile = SETUP_PROFILES["omny"]
|
||||
for tomo_type in (1, 4, 5):
|
||||
assert "zero_deg_reference_at_each_subtomo" not in _irrelevant_params_for_type(tomo_type)
|
||||
assert "zero_deg_reference_at_each_subtomo" not in _irrelevant_params_for_type(
|
||||
tomo_type, profile
|
||||
)
|
||||
for tomo_type in (2, 3):
|
||||
assert "zero_deg_reference_at_each_subtomo" in _irrelevant_params_for_type(tomo_type)
|
||||
assert "zero_deg_reference_at_each_subtomo" in _irrelevant_params_for_type(
|
||||
tomo_type, profile
|
||||
)
|
||||
|
||||
|
||||
# --- _validate()'s tomo_type check: regression guard for the critical fix --
|
||||
|
||||
@@ -139,7 +139,7 @@ def test_tomo_queue_execute_resumes_incomplete_job():
|
||||
|
||||
omny.tomo_queue_execute()
|
||||
|
||||
assert calls == [("resume", (), {})]
|
||||
assert calls == [("resume", (), {"from_queue": True})]
|
||||
job = omny._tomo_queue_proxy.as_list()[0]
|
||||
assert job["status"] == "done"
|
||||
|
||||
|
||||
@@ -525,6 +525,7 @@ def test_write_to_scilog_tolerates_send_exception(monkeypatch):
|
||||
def test_write_tomo_scan_number_creates_missing_directory(monkeypatch, tmp_path):
|
||||
monkeypatch.setenv("HOME", str(tmp_path))
|
||||
omny = object.__new__(OMNY)
|
||||
omny.client = FakeGlobalVarClient()
|
||||
omny.tomo_id = 1
|
||||
fake_dev = types.SimpleNamespace(
|
||||
osamroy=types.SimpleNamespace(read=lambda: {"osamroy": {"value": 12.5}}),
|
||||
|
||||
Reference in new issue
Block a user