tests: update test_server for changes to moonraker

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
Eric Callahan 2022-02-23 11:28:14 -05:00
parent 54f2ee61d0
commit 1fbfb90500
1 changed files with 11 additions and 3 deletions

View File

@ -6,7 +6,7 @@ import socket
import pathlib
from collections import namedtuple
from moonraker import CORE_COMPONENTS, Server
from moonraker import CORE_COMPONENTS, Server, API_VERSION
from moonraker import main as servermain
from eventloop import EventLoop
from utils import ServerError
@ -91,6 +91,10 @@ class TestInstantiation:
}
assert base_server.get_app_args() == args
def test_api_version(self, base_server: Server):
ver = base_server.get_api_version()
assert ver == API_VERSION
def test_pending_tasks(self, base_server: Server):
loop = base_server.get_event_loop().aioloop
assert len(asyncio.all_tasks(loop)) == 0
@ -436,7 +440,9 @@ class TestEndpoints:
'warnings': [],
'websocket_count': 0,
'moonraker_version': "moonraker-pytest",
'missing_klippy_requirements': []
'missing_klippy_requirements': [],
'api_version': list(API_VERSION),
'api_version_string': ".".join(str(v) for v in API_VERSION)
}
assert ret["result"] == expected
@ -463,7 +469,9 @@ class TestEndpoints:
'warnings': [],
'websocket_count': 1,
'moonraker_version': "moonraker-pytest",
'missing_klippy_requirements': []
'missing_klippy_requirements': [],
'api_version': list(API_VERSION),
'api_version_string': ".".join(str(v) for v in API_VERSION)
}
assert ret == expected