mirror of
https://github.com/bec-project/bec_widgets.git
synced 2025-07-14 03:31:50 +02:00
33 lines
892 B
Python
33 lines
892 B
Python
import argparse
|
|
|
|
import pytest
|
|
from bec_lib.service_config import ServiceConfig
|
|
|
|
from bec_widgets.cli.server import GUIServer
|
|
|
|
|
|
@pytest.fixture
|
|
def gui_server():
|
|
args = argparse.Namespace(
|
|
config=None, id="gui_id", gui_class="LaunchWindow", gui_class_id="bec", hide=False
|
|
)
|
|
return GUIServer(args=args)
|
|
|
|
|
|
def test_gui_server_start_server_without_service_config(gui_server):
|
|
"""
|
|
Test that the server is started with the correct arguments.
|
|
"""
|
|
assert gui_server.config is None
|
|
assert gui_server.gui_id == "gui_id"
|
|
assert gui_server.gui_class == "LaunchWindow"
|
|
assert gui_server.gui_class_id == "bec"
|
|
assert gui_server.hide is False
|
|
|
|
|
|
def test_gui_server_get_service_config(gui_server):
|
|
"""
|
|
Test that the server is started with the correct arguments.
|
|
"""
|
|
assert gui_server._get_service_config().config is ServiceConfig().config
|