diff --git a/api/tests/opentrons/protocol_api/core/engine/test_absorbance_reader_core.py b/api/tests/opentrons/protocol_api/core/engine/test_absorbance_reader_core.py index fd537d4cad93..6a602711ea28 100644 --- a/api/tests/opentrons/protocol_api/core/engine/test_absorbance_reader_core.py +++ b/api/tests/opentrons/protocol_api/core/engine/test_absorbance_reader_core.py @@ -69,59 +69,67 @@ def test_initialize( ) -> None: """It should set the sample wavelength with the engine client.""" subject._ready_to_initialize = True - subject.initialize("single", [123]) + subject.initialize("single", [350]) decoy.verify( mock_engine_client.execute_command( cmd.absorbance_reader.InitializeParams( moduleId="1234", measureMode="single", - sampleWavelengths=[123], + sampleWavelengths=[350], referenceWavelength=None, ), ), times=1, ) - assert subject._initialized_value == [123] + assert subject._initialized_value == [350] # Test reference wavelength - subject.initialize("single", [124], 450) + subject.initialize("single", [350], 450) decoy.verify( mock_engine_client.execute_command( cmd.absorbance_reader.InitializeParams( moduleId="1234", measureMode="single", - sampleWavelengths=[124], + sampleWavelengths=[350], referenceWavelength=450, ), ), times=1, ) - assert subject._initialized_value == [124] + assert subject._initialized_value == [250] # Test initialize multi - subject.initialize("multi", [124, 125, 126]) + subject.initialize("multi", [350, 400, 450]) decoy.verify( mock_engine_client.execute_command( cmd.absorbance_reader.InitializeParams( moduleId="1234", measureMode="multi", - sampleWavelengths=[124, 125, 126], + sampleWavelengths=[350, 400, 450], referenceWavelength=None, ), ), times=1, ) - assert subject._initialized_value == [124, 125, 126] + assert subject._initialized_value == [350, 400, 450] def test_initialize_not_ready(subject: AbsorbanceReaderCore) -> None: """It should raise CannotPerformModuleAction if you dont call .close_lid() command.""" subject._ready_to_initialize = False with pytest.raises(CannotPerformModuleAction): - subject.initialize("single", [123]) + subject.initialize("single", [350]) + + +@pytest.mark.parametrize("wavelength", [-350, 0, 1200, "wda"]) +def test_invalid_wavelengths(wavelength: int, subject: AbsorbanceReaderCore) -> None: + """It should raise ValueError if you provide an invalid wavelength""" + subject._ready_to_initialize = True + with pytest.raises(ValueError): + subject.initialize("single", [wavelength]) def test_read( @@ -129,7 +137,7 @@ def test_read( ) -> None: """It should call absorbance reader to read with the engine client.""" subject._ready_to_initialize = True - subject._initialized_value = [123] + subject._initialized_value = [350] substate = AbsorbanceReaderSubState( module_id=AbsorbanceReaderId(subject.module_id), configured=True, @@ -152,6 +160,7 @@ def test_read( mock_engine_client.execute_command( cmd.absorbance_reader.ReadAbsorbanceParams( moduleId="1234", + fileName=None, ), ), times=1,