File: test_set_device_power_status.py

package info (click to toggle)
python-apsystems-ez1 2.3.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,328 kB
  • sloc: python: 697; makefile: 5
file content (24 lines) | stat: -rw-r--r-- 595 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import pytest


@pytest.mark.asyncio
@pytest.mark.parametrize(
    "input_status, expected_status, test_id",
    [
        (True, 0, "happy_path_start_inverter_with_tue"),
        (False, 1, "happy_path_start_inverter_with_False"),
    ],
)
async def test_set_device_power_status_happy_paths(
    input_status, expected_status, test_id, mock_response
):
    # Arrange
    ez1m = mock_response({"data": {"status": expected_status}, "status": 0})

    # Act
    result = await ez1m.set_device_power_status(input_status)

    # Assert
    assert result == input_status, f"Test Failed: {test_id}"