Skip to content

Commit

Permalink
Additional tests
Browse files Browse the repository at this point in the history
  • Loading branch information
albireox committed Dec 25, 2024
1 parent 752bb57 commit 2250d58
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion tests/test_command_dome.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

from typing import TYPE_CHECKING

import lvmecp.dome
from lvmecp.maskbits import DomeStatus


Expand All @@ -20,7 +21,7 @@


async def test_command_dome_open(actor: ECPActor, mocker: MockerFixture):
mocker.patch.object(actor.plc.dome, "is_allowed", return_value=True)
mocker.patch.object(actor.plc.dome, "is_daytime", return_value=False)
mocker.patch.object(actor.plc.dome, "_move", return_value=True)

mocker.patch.object(actor.plc.dome, "status", return_value=DomeStatus.OPEN)
Expand Down Expand Up @@ -52,6 +53,23 @@ async def test_command_dome_daytime(actor: ECPActor, mocker: MockerFixture):
assert cmd.status.did_fail


async def test_command_dome_daytime_allowed(actor: ECPActor, mocker: MockerFixture):
mocker.patch.object(
lvmecp.dome,
"config",
return_value={"dome": {"daytime_allowed": True}},
)
mocker.patch.object(actor.plc.dome, "is_daytime", return_value=True)
mocker.patch.object(actor.plc.dome, "_move", return_value=True)

mocker.patch.object(actor.plc.dome, "status", return_value=DomeStatus.OPEN)

cmd = await actor.invoke_mock_command("dome open")
await cmd

assert cmd.status.did_succeed


async def test_command_dome_daytime_eng_mode(actor: ECPActor, mocker: MockerFixture):
mocker.patch.object(actor.plc.dome, "is_daytime", return_value=True)
mocker.patch.object(actor.plc.dome, "_move", return_value=True)
Expand Down

0 comments on commit 2250d58

Please sign in to comment.