File: body_test.py

package info (click to toggle)
python-xknx 3.14.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,064 kB
  • sloc: python: 40,895; javascript: 8,556; makefile: 32; sh: 12
file content (22 lines) | stat: -rw-r--r-- 741 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
"""Unit test for KNX/IP Body base class."""

from unittest.mock import patch

from xknx.knxip import KNXIPBody, KNXIPBodyResponse


class TestKNXIPBody:
    """Test base class for KNX/IP bodys."""

    @patch.multiple(KNXIPBody, __abstractmethods__=set())
    def test_body_attributes(self) -> None:
        """Test attributes of KNXIPBody base class."""
        body = KNXIPBody()
        assert hasattr(body, "SERVICE_TYPE")

    @patch.multiple(KNXIPBodyResponse, __abstractmethods__=set())
    def test_response_attributes(self) -> None:
        """Test attributes of KNXIPBodyResponse base class."""
        response = KNXIPBodyResponse()
        assert hasattr(response, "SERVICE_TYPE")
        assert hasattr(response, "status_code")