Skip to content

Commit

Permalink
final changes to test
Browse files Browse the repository at this point in the history
  • Loading branch information
parfa30 committed Dec 5, 2024
1 parent 566465a commit 8fc43d4
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions tests/test_maintel_power_off_tunablelaser.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,23 +122,13 @@ async def configure_mocks(self):
self.script.laser.configure_mock(
**{
"evt_summaryState.aget.side_effect": self.mock_get_laser_summary_state,
"cmd_setOpticalConfiguration.set_start.side_effect": self.mock_set_optical_config,
"cmd_setContinuousMode.start.side_effect": self.mock_set_continuous_mode,
"cmd_startPropagateLaser.start.side_effect": self.mock_stop_laser,
}
)

async def mock_get_laser_summary_state(self, **kwargs):
return types.SimpleNamespace(summaryState=salobj.State.ENABLED)

async def mock_set_optical_config(self, **kwargs):
self.optical_config_state = types.SimpleNamespace(configuration="SCU")

async def mock_set_continuous_mode(self, **kwargs):
self.laser_state = types.SimpleNamespace(
detailedState=LaserDetailedState.NONPROPAGATING_CONTINUOUS_MODE
)

async def mock_stop_laser(self, **kwargs):
self.laser_state = types.SimpleNamespace(
detailedState=LaserDetailedState.NONROPAGATING_CONTINUOUS_MODE
Expand All @@ -147,16 +137,9 @@ async def mock_stop_laser(self, **kwargs):
async def test_configure(self):
# Try to configure with only some of the optional parameters
async with self.make_script():
mode = LaserDetailedState.PROPAGATING_CONTINUOUS_MODE
optical_configuration = LaserOpticalConfiguration.SCU.name
wavelength = 500.0

await self.configure_script()

assert self.script.laser_mode == mode
assert self.script.optical_configuration == optical_configuration
assert self.script.wavelength == wavelength

async def test_run_without_failures(self):
async with self.make_script():
await self.configure_script()
Expand All @@ -171,10 +154,6 @@ async def test_run_without_failures(self):
self.laser_state.detailedState
== LaserDetailedState.NONPROPAGATING_CONTINUOUS_MODE
)
assert (
self.script.optical_configuration == LaserOpticalConfiguration.SCU.name
)
assert self.script.wavelength == 500.0

async def test_executable(self):
scripts_dir = standardscripts.get_scripts_dir()
Expand Down

0 comments on commit 8fc43d4

Please sign in to comment.