Dinnerbone / mcstatus

A Python class for checking the status of an enabled Minecraft server

Home Page:http://dinnerbone.com/minecraft/tools/status/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unit test for async ping fails on Windows

kevinkjt2000 opened this issue · comments

====================================================== FAILURES =======================================================
______________________________________ TestAsyncMinecraftServer.test_async_ping _______________________________________

self = <mcstatus.tests.test_server.TestAsyncMinecraftServer object at 0x000002315B6AED00>, unused_tcp_port = 58432
create_mock_packet_server = <function create_mock_packet_server.<locals>.create_server at 0x000002315B63D1F0>

    @pytest.mark.asyncio
    async def test_async_ping(self, unused_tcp_port, create_mock_packet_server):
        mock_packet_server = await create_mock_packet_server(
            port=unused_tcp_port,
            data_expected_to_receive=bytearray.fromhex("09010000000001C54246"),
            data_to_respond_with=bytearray.fromhex("0F002F096C6F63616C686F737463DD0109010000000001C54246"),
        )
        minecraft_server = MinecraftServer("localhost", port=unused_tcp_port)

>       latency = await minecraft_server.async_ping(ping_token=29704774, version=47)

mcstatus\tests\test_server.py:69:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
mcstatus\server.py:95: in async_ping
    raise exception_to_raise_after_giving_up
mcstatus\server.py:89: in async_ping
    ping = await pinger.test_ping()
mcstatus\pinger.py:102: in test_ping
    response = await self.connection.read_buffer()
mcstatus\protocol\connection.py:174: in read_buffer
    length = await self.read_varint()
mcstatus\protocol\connection.py:139: in read_varint
    part = ord(await self.read(1))

My guess is the patching of the socket that works on Linux does not work on Windows.