File: test_device.py

package info (click to toggle)
python-asusrouter 1.21.3-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,856 kB
  • sloc: python: 20,497; makefile: 3
file content (28 lines) | stat: -rw-r--r-- 783 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
25
26
27
28
"""Tests for device module."""

import pytest

from asusrouter.const import UNKNOWN_MEMBER
from asusrouter.modules.device import DeviceOperationMode


class TestDeviceOperationMode:
    """Tests for the DeviceOperationMode enum."""

    @pytest.mark.parametrize(
        ("name", "value"),
        [
            ("UNKNOWN", UNKNOWN_MEMBER),
            ("ROUTER", 1),
            ("REPEATER", 2),
            ("ACCESS_POINT", 3),
            ("MEDIA_BRIDGE", 4),
            ("AIMESH_NODE", 5),
        ],
    )
    def test_enum_members_and_values(self, name: str, value: int) -> None:
        """Enum members exist and have the expected integer values."""

        member = getattr(DeviceOperationMode, name)
        assert member.name == name
        assert member.value == value