|
2 | 2 | from pathlib import Path |
3 | 3 | from unittest.mock import patch |
4 | 4 |
|
| 5 | +import pytest |
| 6 | + |
| 7 | +import squadds.simulations.ansys_simulator as ansys_simulator_module |
5 | 8 | from squadds.simulations.ansys_simulator import AnsysSimulator |
6 | 9 | from squadds.simulations.drivenmodal.models import ( |
7 | 10 | CapacitanceExtractionRequest, |
@@ -151,6 +154,24 @@ def test_normalize_device_dict_deserializes_json_like_payloads(headless_qiskit_e |
151 | 154 | assert simulator.device_dict["setup_cavity_claw"] == {"max_passes": 15} |
152 | 155 |
|
153 | 156 |
|
| 157 | +def test_simulate_raises_when_low_level_simulation_returns_none(monkeypatch, headless_qiskit_environment): |
| 158 | + simulator = AnsysSimulator( |
| 159 | + DummyAnalyzer("qubit"), |
| 160 | + { |
| 161 | + "design_options": {"cross_length": "200um"}, |
| 162 | + "setup": {"max_passes": 1}, |
| 163 | + }, |
| 164 | + ) |
| 165 | + |
| 166 | + def fake_simulate_single_design(*args, **kwargs): |
| 167 | + return None, None, None |
| 168 | + |
| 169 | + monkeypatch.setattr(ansys_simulator_module, "simulate_single_design", fake_simulate_single_design) |
| 170 | + |
| 171 | + with pytest.raises(RuntimeError, match="completed without a result payload"): |
| 172 | + simulator.simulate() |
| 173 | + |
| 174 | + |
154 | 175 | def test_run_drivenmodal_initializes_checkpoint_manifest(headless_qiskit_environment, tmp_path: Path): |
155 | 176 | simulator = AnsysSimulator( |
156 | 177 | DummyAnalyzer("qubit_claw"), |
|
0 commit comments