Beispiel #1
0
 def test_greeting_failed(self, mock_wrap_socket, mock_socket_connect):
     mock_socket_connect.return_value = True
     mock_wrap_socket.return_value = io.BytesIO(
         epp_client.int_to_net(12, epp_client.get_format_32()) +
         b'bad greeting')
     with pytest.raises(AttributeError):
         conn().open()
Beispiel #2
0
def fake_response(xml_response):
    return epp_client.int_to_net(len(xml_response) + 4, epp_client.get_format_32()) + xml_response.encode()
Beispiel #3
0
 def test_int_from_net(self):
     assert epp_client.int_from_net(b'\x00\x01\x02\x03',
                                    epp_client.get_format_32()) == 66051
Beispiel #4
0
 def test_int_to_net(self):
     assert epp_client.int_to_net(
         len(sample_greeting),
         epp_client.get_format_32()) == b'\x00\x00\x03\xe3'