2019-05-14 15:51:03 -04:00
|
|
|
import pytest
|
|
|
|
from janus import Queue
|
|
|
|
|
|
|
|
from conftest import faker
|
2019-05-21 07:42:48 -04:00
|
|
|
from pantalaimon.config import ServerConfig
|
2019-05-21 10:48:46 -04:00
|
|
|
from pantalaimon.ui import Control, IdCounter
|
2019-05-14 15:51:03 -04:00
|
|
|
|
|
|
|
|
|
|
|
class TestClass(object):
|
2019-05-21 07:42:48 -04:00
|
|
|
def test_server_account_storing(self, panstore):
|
|
|
|
domain = faker.domain_name()
|
|
|
|
|
|
|
|
server_list = [
|
|
|
|
ServerConfig(
|
|
|
|
domain,
|
|
|
|
faker.url("http"),
|
|
|
|
faker.ipv4(),
|
|
|
|
8080,
|
|
|
|
)
|
|
|
|
]
|
2019-05-14 15:51:03 -04:00
|
|
|
|
|
|
|
queue = Queue()
|
|
|
|
counter = IdCounter()
|
2019-05-21 07:42:48 -04:00
|
|
|
control = Control(queue.sync_q, panstore, server_list, counter)
|
2019-05-14 15:51:03 -04:00
|
|
|
|
2019-05-21 07:42:48 -04:00
|
|
|
assert control.ListServers() == {domain: []}
|