Skip to content

Commit

Permalink
In test_cp_verify_alarm.py, publich the mock OCPS event.
Browse files Browse the repository at this point in the history
  • Loading branch information
plazas committed Jan 13, 2023
1 parent c88bb70 commit e8a4e88
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions tests/rules/test_cp_verify_alarm.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,9 @@ async def test_call(self):
# use mock OCPS response and verify data below to test
# self.check_response(response, verify_stats) in the alarm

async with salobj.Controller(
name="ScriptQueue", index=ocps_index
) as script_queue:
async with salobj.Controller(name="OCPS", index=ocps_index) as ocps:
async with watcher.Model(
domain=script_queue.domain, config=watcher_config
domain=ocps.domain, config=watcher_config
) as model:
model.enable()

Expand All @@ -112,17 +110,10 @@ async def test_call(self):
rule.alarm.init_severity_queue()

for test_params in self.get_test_params():
response_verify = await self.mock_latiss_ocps_response()

await script_queue.evt_queue.set_write(
enabled=test_params.queue_enabled,
running=test_params.queue_running,
currentSalIndex=test_params.script_sal_index,
)

await script_queue.evt_script.set_write(
scriptSalIndex=test_params.script_sal_index,
processState=test_params.process_state,
scriptState=test_params.script_state,
await ocps.evt_job_result.set_write(
result=response_verify,
)

# This will publish 2 alarm states for each set of test
Expand Down

0 comments on commit e8a4e88

Please sign in to comment.