vban-cmd-python/tests/__init__.py

29 lines
742 B
Python
Raw Normal View History

import vbancmd
from vbancmd import kinds
from vbancmd.channel import Modes
2022-02-25 15:17:05 +00:00
import socket
from threading import Thread
_kind = 'potato'
opts = {
'ip': 'ws.local',
'streamname': 'testing',
'port': 6990,
'bps': 0,
}
2022-02-25 15:17:05 +00:00
vbanrs = {kind.id: vbancmd.connect(_kind, **opts) for kind in kinds.all}
2022-02-25 15:17:05 +00:00
tests = vbanrs[_kind]
def setup_package():
tests._modes = Modes()
2022-02-25 15:17:05 +00:00
tests._rt_packet_socket.bind((socket.gethostbyname(socket.gethostname()), tests._port))
tests.worker = Thread(target=tests._send_register_rt, daemon=True)
tests.worker.start()
2022-03-05 20:22:10 +00:00
tests._public_packet = tests._get_rt()
tests.worker2 = Thread(target=tests._keepupdated, daemon=True)
tests.worker2.start()
2022-02-25 15:17:05 +00:00
def teardown_package():
2022-03-05 20:22:10 +00:00
tests.close()