2022-03-04 14:22:29 +00:00
|
|
|
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
|
|
|
|
|
2022-02-28 18:14:31 +00:00
|
|
|
_kind = 'potato'
|
|
|
|
opts = {
|
|
|
|
'ip': 'ws.local',
|
|
|
|
'streamname': 'testing',
|
2022-03-02 21:06:39 +00:00
|
|
|
'port': 6990,
|
2022-02-28 18:14:31 +00:00
|
|
|
'bps': 0,
|
2022-03-02 21:06:39 +00:00
|
|
|
'channel': 3
|
2022-02-28 18:14:31 +00:00
|
|
|
}
|
2022-02-25 15:17:05 +00:00
|
|
|
|
2022-03-04 14:22:29 +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():
|
2022-03-02 21:06:39 +00:00
|
|
|
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-02-25 17:02:27 +00:00
|
|
|
|
2022-02-25 15:17:05 +00:00
|
|
|
def teardown_package():
|
2022-02-28 18:14:31 +00:00
|
|
|
tests._rt_packet_socket.close()
|
|
|
|
tests._rt_register_socket.close()
|
|
|
|
tests._sendrequest_string_socket.close()
|