mirror of https://github.com/conqp/rcon
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
621 B
24 lines
621 B
from unittest import TestCase
|
|
from socket import socket, AF_INET
|
|
|
|
import pytest
|
|
|
|
from rcon.source import Client
|
|
|
|
HOST: str = "localhost"
|
|
PORT: int = 25575
|
|
|
|
|
|
class TestLocalMinecraftServer(TestCase):
|
|
def setUp(self):
|
|
self.client = Client(HOST, PORT, passwd="test")
|
|
|
|
@pytest.mark.skipif(
|
|
socket(AF_INET).connect_ex((HOST, PORT)) != 0,
|
|
reason="requires a local Minecraft server to be running",
|
|
)
|
|
def test_list_empty(self):
|
|
with self.client as client:
|
|
response = client.run("list")
|
|
|
|
self.assertEqual(response, "There are 0 of a max of 20 players online: ")
|
|
|