kopia lustrzana https://github.com/Yakifo/amqtt
fixing warning
rodzic
895672731f
commit
b90b53e755
|
@ -30,32 +30,31 @@ def rsa_keys():
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def test_config(rsa_keys):
|
def test_config(rsa_keys):
|
||||||
certfile, keyfile = rsa_keys
|
certfile, keyfile = rsa_keys
|
||||||
with pytest.warns(DeprecationWarning):
|
yield {
|
||||||
yield {
|
"listeners": {
|
||||||
"listeners": {
|
"default": {"type": "tcp", "bind": "127.0.0.1:1883", "max_connections": 15},
|
||||||
"default": {"type": "tcp", "bind": "127.0.0.1:1883", "max_connections": 15},
|
"mqtts": {
|
||||||
"mqtts": {
|
"type": "tcp",
|
||||||
"type": "tcp",
|
"bind": "127.0.0.1:1884",
|
||||||
"bind": "127.0.0.1:1884",
|
"max_connections": 15,
|
||||||
"max_connections": 15,
|
"ssl": True,
|
||||||
"ssl": True,
|
"certfile": certfile,
|
||||||
"certfile": certfile,
|
"keyfile": keyfile
|
||||||
"keyfile": keyfile
|
|
||||||
},
|
|
||||||
"ws": {"type": "ws", "bind": "127.0.0.1:8080", "max_connections": 15},
|
|
||||||
"wss": {
|
|
||||||
"type": "ws",
|
|
||||||
"bind": "127.0.0.1:8081",
|
|
||||||
"max_connections": 15,
|
|
||||||
"ssl": True,
|
|
||||||
'certfile': certfile,
|
|
||||||
'keyfile': keyfile},
|
|
||||||
},
|
},
|
||||||
"sys_interval": 0,
|
"ws": {"type": "ws", "bind": "127.0.0.1:8080", "max_connections": 15},
|
||||||
"auth": {
|
"wss": {
|
||||||
"allow-anonymous": True,
|
"type": "ws",
|
||||||
}
|
"bind": "127.0.0.1:8081",
|
||||||
|
"max_connections": 15,
|
||||||
|
"ssl": True,
|
||||||
|
'certfile': certfile,
|
||||||
|
'keyfile': keyfile},
|
||||||
|
},
|
||||||
|
"sys_interval": 0,
|
||||||
|
"auth": {
|
||||||
|
"allow-anonymous": True,
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
test_config_acl: dict[str, int | dict[str, Any]] = {
|
test_config_acl: dict[str, int | dict[str, Any]] = {
|
||||||
"listeners": {
|
"listeners": {
|
||||||
|
@ -94,13 +93,14 @@ def mock_plugin_manager():
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
async def broker_fixture(test_config):
|
async def broker_fixture(test_config):
|
||||||
broker = Broker(test_config, plugin_namespace="amqtt.test.plugins")
|
with pytest.warns(DeprecationWarning):
|
||||||
await broker.start()
|
broker = Broker(test_config, plugin_namespace="amqtt.test.plugins")
|
||||||
assert broker.transitions.is_started()
|
await broker.start()
|
||||||
assert broker._sessions == {}
|
assert broker.transitions.is_started()
|
||||||
assert "default" in broker._servers
|
assert broker._sessions == {}
|
||||||
|
assert "default" in broker._servers
|
||||||
|
|
||||||
yield broker
|
yield broker
|
||||||
|
|
||||||
if not broker.transitions.is_stopped():
|
if not broker.transitions.is_stopped():
|
||||||
await broker.shutdown()
|
await broker.shutdown()
|
||||||
|
|
Ładowanie…
Reference in New Issue