Skip to content

Commit 27f3298

Browse files
committed
Fix tests and remove lower limit for engineering mode timeout
1 parent 63ca4bd commit 27f3298

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

python/lvmecp/actor/commands/engineering.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def engineering_mode():
6565
@click.option(
6666
"--timeout",
6767
"-t",
68-
type=click.FloatRange(min=0.1, max=300),
68+
type=click.FloatRange(min=0, max=300),
6969
help="Timeout for the engineering mode, in hours. "
7070
"If not passed, the default timeout is used.",
7171
)

tests/test_command_engineering_mode.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ async def test_command_engineering_mode_enable(actor: ECPActor, mocker: MockerFi
3535
await cmd
3636

3737
assert cmd.status.did_succeed
38-
eng_mode_mock.assert_called_once_with(True, timeout=10)
38+
eng_mode_mock.assert_called_once_with(True, timeout=36000)
3939

4040

4141
async def test_command_engineering_mode_no_mock(actor: ECPActor):
@@ -53,7 +53,8 @@ async def test_command_engineering_mode_no_mock(actor: ECPActor):
5353
async def test_command_engineering_mode_timeouts(actor: ECPActor):
5454
actor._eng_mode_hearbeat_interval = 0.1 # To speed up the test
5555

56-
cmd = await actor.invoke_mock_command("engineering-mode enable --timeout 1")
56+
one_s = 1 / 3600
57+
cmd = await actor.invoke_mock_command(f"engineering-mode enable --timeout {one_s}")
5758
await cmd
5859

5960
assert actor.is_eng_mode_enabled() is True

0 commit comments

Comments
 (0)