Example #1
0
 def test_connect_response(self):
     """Test string representatoin of KNX/IP ConnectResponse."""
     xknx = XKNX(loop=self.loop)
     connect_response = ConnectResponse(xknx)
     connect_response.communication_channel = 13
     connect_response.request_type = ConnectRequestType.TUNNEL_CONNECTION
     connect_response.control_endpoint = HPAI(ip_addr='192.168.42.1', port=33941)
     connect_response.identifier = 42
     self.assertEqual(
         str(connect_response),
         '<ConnectResponse communication_channel="13" status_code="ErrorCode.E_NO_ERROR" control_endpoint="<HPAI 192.168.42.1:33941 />" request_t'
         'ype="ConnectRequestType.TUNNEL_CONNECTION" identifier="42" />')
Example #2
0
 def test_connect_response(self):
     """Test string representatoin of KNX/IP ConnectResponse."""
     xknx = XKNX(loop=self.loop)
     connect_response = ConnectResponse(xknx)
     connect_response.communication_channel = 13
     connect_response.request_type = ConnectRequestType.TUNNEL_CONNECTION
     connect_response.control_endpoint = HPAI(ip_addr='192.168.42.1', port=33941)
     connect_response.identifier = 42
     self.assertEqual(
         str(connect_response),
         '<ConnectResponse communication_channel="13" status_code="ErrorCode.E_NO_ERROR" control_endpoint="<HPAI 192.168.42.1:33941 />" request_t'
         'ype="ConnectRequestType.TUNNEL_CONNECTION" identifier="42" />')
Example #3
0
 def test_connect_response(self):
     """Test string representatoin of KNX/IP ConnectResponse."""
     connect_response = ConnectResponse()
     connect_response.communication_channel = 13
     connect_response.request_type = ConnectRequestType.TUNNEL_CONNECTION
     connect_response.data_endpoint = HPAI(ip_addr="192.168.42.1",
                                           port=33941)
     connect_response.identifier = 42
     assert (
         str(connect_response) ==
         '<ConnectResponse communication_channel="13" status_code="ErrorCode.E_NO_ERROR" '
         'data_endpoint="192.168.42.1:33941/udp" '
         'request_type="ConnectRequestType.TUNNEL_CONNECTION" identifier="42" />'
     )