|
8 | 8 | from bluesky.protocols import Readable |
9 | 9 | from ophyd_async.epics.motor import Motor |
10 | 10 |
|
11 | | -from dodal.beamlines import i03, i23 |
| 11 | +from dodal.beamlines import i04, i23 |
12 | 12 | from dodal.devices.diamond_filter import DiamondFilter, I03Filters |
13 | 13 | from dodal.utils import ( |
14 | 14 | AnyDevice, |
@@ -313,7 +313,7 @@ def test_invalid_beamline_variable_causes_get_device_module_to_raise(bl): |
313 | 313 | get_beamline_based_on_environment_variable() |
314 | 314 |
|
315 | 315 |
|
316 | | -@pytest.mark.parametrize("bl,module", [("i03", i03), ("i23", i23)]) |
| 316 | +@pytest.mark.parametrize("bl,module", [("i04", i04), ("i23", i23)]) |
317 | 317 | def test_valid_beamline_variable_causes_get_device_module_to_return_module(bl, module): |
318 | 318 | with patch.dict(os.environ, {"BEAMLINE": bl}): |
319 | 319 | assert get_beamline_based_on_environment_variable() == module |
@@ -488,40 +488,24 @@ def test_is_v2_device_type(input: Any, expected_result: bool): |
488 | 488 |
|
489 | 489 |
|
490 | 490 | def test_calling_factory_with_different_args_raises_an_exception(): |
491 | | - i03.undulator(daq_configuration_path=MOCK_DAQ_CONFIG_PATH) |
| 491 | + i04.oav(params=MagicMock()) |
492 | 492 | with pytest.raises( |
493 | 493 | RuntimeError, |
494 | 494 | match="Device factory method called multiple times with different parameters", |
495 | 495 | ): |
496 | | - i03.undulator(daq_configuration_path=MOCK_DAQ_CONFIG_PATH + "x") |
497 | | - i03.undulator.cache_clear() |
| 496 | + i04.oav(params=MagicMock()) |
| 497 | + i04.oav.cache_clear() |
498 | 498 |
|
499 | 499 |
|
500 | | -def test_calling_factory_with_different_args_does_not_raise_an_exception_after_cache_clear( |
501 | | - alternate_config, |
502 | | -): |
503 | | - i03.undulator(daq_configuration_path=MOCK_DAQ_CONFIG_PATH) |
504 | | - i03.undulator.cache_clear() |
505 | | - i03.undulator(daq_configuration_path=alternate_config) |
506 | | - i03.undulator.cache_clear() |
507 | | - |
508 | | - |
509 | | -def test_factories_can_be_called_in_any_order(alternate_config): |
510 | | - i03.undulator_dcm(daq_configuration_path=alternate_config) |
511 | | - i03.undulator(daq_configuration_path=alternate_config) |
512 | | - |
513 | | - i03.undulator_dcm.cache_clear() |
514 | | - i03.undulator.cache_clear() |
515 | | - |
516 | | - i03.undulator(daq_configuration_path=alternate_config) |
517 | | - i03.undulator_dcm(daq_configuration_path=alternate_config) |
518 | | - |
519 | | - i03.undulator.cache_clear() |
520 | | - i03.undulator_dcm.cache_clear() |
| 500 | +def test_calling_factory_with_different_args_does_not_raise_an_exception_after_cache_clear(): |
| 501 | + i04.oav(params=MagicMock()) |
| 502 | + i04.oav.cache_clear() |
| 503 | + i04.oav(params=MagicMock()) |
| 504 | + i04.oav.cache_clear() |
521 | 505 |
|
522 | 506 |
|
523 | | -def test_factory_calls_are_cached(alternate_config): |
524 | | - undulator1 = i03.undulator(daq_configuration_path=alternate_config) |
525 | | - undulator2 = i03.undulator(daq_configuration_path=alternate_config) |
| 507 | +def test_factory_calls_are_cached(): |
| 508 | + undulator1 = i04.undulator() |
| 509 | + undulator2 = i04.undulator() |
526 | 510 | assert undulator1 is undulator2 |
527 | | - i03.undulator.cache_clear() |
| 511 | + i04.undulator.cache_clear() |
0 commit comments