tests: Fix the dbus test.

This commit is contained in:
Damir Jelić 2019-05-21 13:42:48 +02:00
parent 48da1b6b14
commit cb38112160
2 changed files with 16 additions and 6 deletions

View File

@ -92,7 +92,7 @@ class ServerConfig:
homeserver = attr.ib(type=ParseResult)
listen_address = attr.ib(type=Union[IPv4Address, IPv6Address])
listen_port = attr.ib(type=int)
proxy = attr.ib(type=str)
proxy = attr.ib(type=str, default="")
ssl = attr.ib(type=bool, default=True)
ignore_verification = attr.ib(type=bool, default=False)

View File

@ -2,15 +2,25 @@ import pytest
from janus import Queue
from conftest import faker
from pantalaimon.ui import Control, Devices, IdCounter
from pantalaimon.ui import Control, IdCounter
from pantalaimon.config import ServerConfig
class TestClass(object):
def test_server_account_storing(self):
users = [(faker.mx_id(), faker.device_id())]
def test_server_account_storing(self, panstore):
domain = faker.domain_name()
server_list = [
ServerConfig(
domain,
faker.url("http"),
faker.ipv4(),
8080,
)
]
queue = Queue()
counter = IdCounter()
control = Control(queue.sync_q, users, counter)
control = Control(queue.sync_q, panstore, server_list, counter)
assert control.ListUsers() == users
assert control.ListServers() == {domain: []}