mirror of
https://github.com/onyx-and-iris/slobs-cli.git
synced 2025-06-27 15:20:24 +01:00
slow down the scene tests in an attempt to avoid rate limiting issues
This commit is contained in:
parent
09a44b2dea
commit
42519ba294
@ -1,5 +1,6 @@
|
||||
"""Test cases for scene commands in slobs_cli."""
|
||||
|
||||
import anyio
|
||||
import pytest
|
||||
from asyncclick.testing import CliRunner
|
||||
|
||||
@ -15,6 +16,7 @@ async def test_scene_list():
|
||||
assert 'slobs-test-scene-1' in result.output
|
||||
assert 'slobs-test-scene-2' in result.output
|
||||
assert 'slobs-test-scene-3' in result.output
|
||||
await anyio.sleep(0.2) # Avoid rate limiting issues
|
||||
|
||||
|
||||
@pytest.mark.anyio
|
||||
@ -23,7 +25,19 @@ async def test_scene_current():
|
||||
runner = CliRunner()
|
||||
result = await runner.invoke(cli, ['scene', 'switch', 'slobs-test-scene-2'])
|
||||
assert result.exit_code == 0
|
||||
await anyio.sleep(0.2) # Avoid rate limiting issues
|
||||
|
||||
result = await runner.invoke(cli, ['scene', 'current'])
|
||||
assert result.exit_code == 0
|
||||
assert 'Current active scene: slobs-test-scene-2' in result.output
|
||||
await anyio.sleep(0.2) # Avoid rate limiting issues
|
||||
|
||||
|
||||
@pytest.mark.anyio
|
||||
async def test_scene_invalid_switch():
|
||||
"""Test switching to an invalid scene."""
|
||||
runner = CliRunner()
|
||||
result = await runner.invoke(cli, ['scene', 'switch', 'invalid-scene'])
|
||||
assert result.exit_code != 0
|
||||
assert 'Scene "invalid-scene" not found' in result.output
|
||||
await anyio.sleep(0.2) # Avoid rate limiting issues
|
||||
|
Loading…
x
Reference in New Issue
Block a user