Wykres commitów

330 Commity (config_dataclasses)

Autor SHA1 Wiadomość Data
Andrew Mirsky 2828a171d7
removing tests due to unreliable external access 2025-06-16 10:13:33 -04:00
Andrew Mirsky c6a7715ddc
fixes Yakifo/amqtt#35 : gather event callbacks upon plugin load so don't have to check all plugins on every fire_event 2025-06-15 20:17:40 -04:00
Andrew Mirsky 3d6e7a8364
added tests for plugin events and broker sys topics 2025-06-15 19:27:47 -04:00
Andrew Mirsky a5487b5cef
Merge branch 'rc' into event_strenum 2025-06-15 10:35:31 -04:00
Andrew Mirsky 99a9594e9f
creating MQTTEvents enumeration instead of individual string names. consolidating into a single file to eliminate import errors 2025-06-15 10:21:41 -04:00
Andrew Mirsky efd8c15375
removing xfail 2025-06-15 06:31:48 -04:00
Andrew Mirsky 012a744b66
removing xfail from test_sys 2025-06-15 06:29:25 -04:00
Andrew Mirsky b0cf416c36
using a strenum instead of enum. creating events as well as client/broker events as well 2025-06-14 21:28:00 -04:00
Andrew Mirsky 4729166d99
lint fix 2025-06-14 15:39:39 -04:00
Andrew Mirsky 364273e684
marking test for broker sys plugin as xfail, because it fails on github workflow but not locally 2025-06-14 15:28:46 -04:00
Andrew Mirsky aace4d65f7
Merge pull request #212 from ajmirsky/plugin_call_optimization
reduce call logic for plugin coros: authenticate, topic_filtering, close
2025-06-14 10:19:39 -04:00
Andrew Mirsky 6b00521ca7
Merge branch 'rc' into issues/199 2025-06-14 10:14:40 -04:00
Andrew Mirsky 54af134832
Merge pull request #203 from ajmirsky/issues/51
fixes Yakifo/amqtt#51 : plugins which fail to import or initialize
2025-06-14 10:11:34 -04:00
Andrew Mirsky 90167d060f
Merge branch 'rc' into issues/199 2025-06-14 10:08:34 -04:00
Andrew Mirsky 101e32af64
Merge branch 'rc' into issues/154 2025-06-14 10:03:09 -04:00
Andrew Mirsky 67fd2970ab
Merge pull request #201 from ajmirsky/issues/67
clarifying reason for `ClientError`
2025-06-14 10:01:06 -04:00
Andrew Mirsky bc44f170ba
Merge branch 'rc' into issues/67 2025-06-14 09:56:01 -04:00
Andrew Mirsky e2842dd7e5
Merge pull request #202 from ajmirsky/issues/86
verify that issue #86 has been fixed
2025-06-14 09:53:42 -04:00
Andrew Mirsky 532c8118e6
Merge branch 'rc' into issues/51 2025-06-14 09:51:42 -04:00
Andrew Mirsky b72c7d4f28
Merge branch 'rc' into plugin_call_optimization 2025-06-14 09:51:12 -04:00
Andrew Mirsky 18ad76bcd3
Merge pull request #213 from ajmirsky/event_strenum
Create `StrEnum` for the broker events
2025-06-14 09:47:19 -04:00
Andrew Mirsky 5a4fb993b7
Merge branch 'rc' into issues/154 2025-06-14 09:44:43 -04:00
Andrew Mirsky d69a14c06a
Merge branch 'rc' into issues/154 2025-06-14 09:40:38 -04:00
Andrew Mirsky 89a0b88491
Merge pull request #211 from ajmirsky/issues_210
fixes amqtt/Yakifo#210 :
2025-06-14 09:39:22 -04:00
Andrew Mirsky 3c07a39877
Merge remote-tracking branch 'source/rc' into event_strenum 2025-06-14 09:38:44 -04:00
Andrew Mirsky 038fee7cf4
remove test_sys 2025-06-14 09:26:55 -04:00
Andrew Mirsky 51102a435b
converting from event strings to a string enumeration 2025-06-13 16:17:22 -04:00
Andrew Mirsky ec1193d439
initial version of alt approach to configuring plugins 2025-06-13 06:40:15 -04:00
Andrew Mirsky 43efa4c829
instead of filtering upon call of the plugin's coro, filter upon plugin loading 2025-06-12 19:12:33 -04:00
Andrew Mirsky fed5b8eb08
shutdown broker when test completes 2025-06-12 11:03:28 -04:00
Andrew Mirsky e7882a3755
fixes amqtt/Yakifo#210 : when reconnect is false, authentication failure causes NoDataError instead of ConnectError 2025-06-12 10:52:44 -04:00
Andrew Mirsky 7b936d785c
loading plugins from config file, bypassing entry points. authenticate and subscribe/publish 2025-06-12 08:37:27 -04:00
Andrew Mirsky e69cb12652
fixing test case for python 3.12 2025-06-09 12:21:22 -04:00
Andrew Mirsky 18bfb6d9c5
python 3.12 requires the connect packet before forcing the socket to disconnect 2025-06-09 00:24:40 -04:00
Andrew Mirsky 2caa792d69
fixes Yakifo/amqtt#51 : plugins which fail to import or load should stop the broker from starting 2025-06-09 00:11:06 -04:00
Andrew Mirsky 2b1599e6af
fixes Yakifo/amqtt#86 : verify that the issue has been fixed 2025-06-08 22:42:49 -04:00
Andrew Mirsky 52b69ee068
fixes Yakifo/amqtt#67 : malformed uri or incorrect scheme should raise a ConnectError (not a ClientError) 2025-06-08 10:29:14 -04:00
Andrew Mirsky 1756d93ebd
removing cli test cases for verifying will messages, better done through unit test cases in test_client.py 2025-06-08 10:00:13 -04:00
Andrew Mirsky ac8782772f
removing inaccurate tests 2025-06-08 07:42:07 -04:00
Andrew Mirsky 58d431f2f5
adding test case for issue 67 2025-06-08 00:06:17 -04:00
Andrew Mirsky 2093cc5961
fixes Yakifo/amqtt#199 : cleanly disconnected clients should not send will messages. fixing client tests, adding additional. and correcting the broker's client handler so that normal or abnormal disconnections end the client's session and stop processing messages from the client 2025-06-07 23:56:30 -04:00
Andrew Mirsky f3291eda2f
fixes Yakifo/amqtt#154 : will message is allowed to have zero length. and the StreamReader can return 'None' or zero and they have different implications. if reading value in order to read from a stream and the length is zero, return a NoDataError. Creating exception class to satisfy EM101 and TRY003 2025-06-07 18:21:08 -04:00
Andrew Mirsky 80016d8cca
Merge pull request #191 from ajmirsky/add_test_coverage
Add test coverage
2025-06-05 11:32:05 -04:00
Andrew Mirsky 9d3d9bd7e2
using 'n' messages to force amqtt_sub to exit, instead of SIGINT which seems to cause the process to force quit instead of causing a keyboard interupt 2025-06-03 18:29:13 -04:00
Andrew Mirsky dd666811a5
increasing timeout for longer running cli tests, adding asyncio wrapper on test_client test 2025-06-03 11:55:03 -04:00
Andrew Mirsky 031ce83107
removing unneeded import 2025-06-03 11:15:48 -04:00
Andrew Mirsky 1752895a39
fixes Yakifo/amqtt#159 : tests/test_client.py::test_client_publish_will_with_retain 2025-06-03 10:58:56 -04:00
Andrew Mirsky 2683e0772e
Merge pull request #182 from ajmirsky/qos_test_cases
Fixing QoS test cases
2025-06-02 23:34:04 -04:00
Andrew Mirsky f049ee2931
python 3.10 still differentiates between asyncio.TimeoutError and the built-in TimeoutError 2025-06-02 23:32:39 -04:00
Andrew Mirsky b30a52386f
Merge branch 'rc' into test_paho 2025-06-01 11:12:46 -04:00
Andrew Mirsky 371e76fb30
adding test to cover adapter base classes. adding test for BrokerSysPlugin 2025-06-01 11:09:40 -04:00
Andrew Mirsky f439f6fb7d
fixing test case to align with additional warning method 2025-05-31 17:11:16 -04:00
Andrew Mirsky 7f60d8d399
Merge branch 'rc' into test_paho 2025-05-31 12:06:06 -04:00
Andrew Mirsky 1e1e2026d3
cleaning up plugin interface and documentation 2025-05-30 18:50:31 -04:00
Andrew Mirsky 4701ba3faa
disabling rich output for script help 2025-05-30 12:21:15 -04:00
Andrew Mirsky 44dfd58972
disabling rich output to verify usage message is generated correctly 2025-05-30 12:11:47 -04:00
Andrew Mirsky 8f9e8afb63
clean up of the command line docs, caused inconsistent behavior between pub and sub script. limiting to mypy 1.15, since newer version has breaking changes 2025-05-29 16:29:05 -04:00
Andrew Mirsky 97436e5dcd
resolve #170. add tests to verify compatibility with paho-mqtt library 2025-05-26 16:49:57 -04:00
Andrew Mirsky ec31def92c
enhancing the 'test_init_handler' case so that it checks to make sure that the ProtocolHandler defaults to the correct loop. 2025-05-26 10:46:11 -04:00
Andrew Mirsky 5c5305baa6
while the explicit close to the asyncio.open_server docs say that you need to close the writer to have it properly exit, it seems that only python 3.12 requires the explicit close 2025-05-26 09:03:51 -04:00
Andrew Mirsky a7f2ae5746
test_init_handler: protocolhandler gets the current loop, if not provided and self.loop isn't the current loop, it's a new loop; ProtocolHandler.__init__: handler was using the session's keepalive, even though if the keepalive is zero, it needs to bypass 2025-05-26 08:48:10 -04:00
Andrew Mirsky 255e38a947
adding debug statements to determine root cause of qos failures 2025-05-25 12:44:54 -04:00
Andrew Mirsky 6afe0cddbb
disabling color output 2025-05-20 12:43:39 -04:00
Andrew Mirsky 82fe0f0ca1
disable colorized cli output for test_cli 2025-05-20 12:38:17 -04:00
Andrew Mirsky 0a50ff02ce
use 'Self' from typing_extensions to support python 3.10. add cli checks for publisher for required 'will' options. update cli test for pub/sub retain 2025-05-20 12:26:22 -04:00
Andrew Mirsky 0401220c38
turn cli exceptions into error message and error codes. added cli tests 2025-05-19 14:23:51 -04:00
Andrew Mirsky 1f2f7a1f79
since the amqtt broker (and MQTT 3.1) requires that that a CONNECT packet be received for a valid socket connection, need to send one (See BrokerProtocolHandler.init_from_connect) otherewise, the connection is immediately closed. asyncio's behavior in python 3.10, 3.11 & 3.13 seems to defer processing the 'read_or_raise' from the socket. however, python 3.12 prioritizes the 'read_or_raise' in the loop so it, triggers a NoDataError, terminating the socket before we can verify in the test. 2025-05-19 12:45:45 -04:00
MVladislav 12d5cb6866 refactor: modularize broker listener startup and improve session management
- Extracted listener startup logic into a separate method `_start_listeners` for better readability and maintainability.
- Created helper methods for SSL context creation.
- Improved session cleanup during shutdown by centralizing logic in `_cleanup_session`.
- Refactored message handling and subscription management into dedicated methods for clarity.
- Updated tests to reflect changes in method visibility for matching topics.
2025-04-06 19:03:30 +02:00
MVladislav 338ff39b17 chore: update version to 0.11.0-beta4, add clear_queues method, and improve resource management in PluginManager and BrokerProtocolHandler 2025-04-04 19:18:17 +02:00
MVladislav 0afe361bd0 fix(#0): renaming file and fix usage
- logging was renamed as logging_a now better as logging_amqtt with fix inside pyproject.toml
- renamed codecs => codecs_a => codecs_amqtt
2025-01-16 20:01:16 +01:00
MVladislav 57bfec0ea8 refactor: more cleanup/linting especial Pylint 2025-01-12 22:44:19 +01:00
MVladislav 40d1214c79 refactor: checking open pull requests:
- #119 :: not working in test cases, only comment
- #153 :: updated
- #61 :: removed try block as described
- #72 :: function included
2025-01-12 21:28:42 +01:00
MVladislav a024b174d0 refactor: more cleanup/linting 2025-01-12 20:52:50 +01:00
MVladislav 1a72fa8e39 refactor: formatting 2024-12-29 19:23:27 +01:00
MVladislav 7c001d69b2 refactor: bigger code upgrade and improves
- add github workflows
- update project.toml by disable multi parts to not see every needed fix now
- improve tests cases
- improve code quality
- ...
2024-12-21 11:52:26 +01:00
MVladislav 7cc746e483 refactor: base cleanup and bring project to run with test cases 2024-12-19 20:34:09 +01:00
rparry-jones d0eb64dc19 #126
- Updated protocol handlers to more reliably remove active waiters when task cancellation occurs
- Fixed checks where expecting a KeyError when it should be checking if not None
- Updated next_packet_id property to correctly check if there are any packet_ids available. Avoids infinite loop if all packet ids are used.
2023-02-27 18:52:11 +01:00
Marius Kriegerowski 7fcdb0c13b broker: release server connection upon exception 2023-02-11 15:53:13 +01:00
Marius Kriegerowski 4944b0deae unit testing tcp connection to the broker 2023-02-11 15:53:06 +01:00
Fabian Elsner 96e89fb37f Fix test for Python 3.7 2023-02-09 12:42:48 +01:00
Fabian Elsner 604c45ca7a Added test for broadcast loop cancellation 2023-02-09 12:42:48 +01:00
Rémi Cardona a3f982c4d2 allow connections with username only
Section [MQTT-3.1.2-22] of the MQTT 3.1.1 only says that a password cannot be
given without a user. The reverse should be allowed. Fixes #79.
2022-04-17 12:05:25 +02:00
Florian Ludwig ecf64a4f82 python pre 3.9 compatibily 2022-02-06 14:42:51 +01:00
Florian Ludwig 42be5c145c reformat with black 2022-02-06 14:42:51 +01:00
Robert Resch 1bc2e06be2 fix flake8 error 2022-02-06 14:42:51 +01:00
Robert Resch 5181289d2b improve has_attr plugin tests 2022-02-06 14:42:51 +01:00
Florian Ludwig d43b36f90c throw exception instance not class and add test 2022-02-06 14:42:51 +01:00
Florian Ludwig 9628a1ce3e remove deprecated loop parameter from tests 2022-01-11 12:55:04 +01:00
Florian Ludwig 4beb912c2a remove legacy cli test 2021-08-17 17:01:58 +02:00
Florian Ludwig 86cec6d2a5 remove hbmqtt plugin namespace compatibility 2021-08-17 17:01:58 +02:00
Stuart Longland 5315e2d865 broker tests: Fix reference to TimeoutError.
Seems Python 3.8+ moved it, and I took the reference from there.
2021-08-17 16:20:27 +02:00
Stuart Longland 3b793a706b broker tests: Clean up flake8 warnings 2021-08-17 16:20:27 +02:00
Stuart Longland fed6d2c31c plugins.topic_checking tests: Fix issues identified by flake8 2021-08-17 16:20:27 +02:00
Stuart Longland bf5279911b Pass code through `black` formatter 2021-08-17 16:20:27 +02:00
Stuart Longland 29854264e3 broker tests: Change passwords for user[1…3]
As pointed out, it's possible to accidentally mix them up if the
passwords are the same.  Obviously, the passwords used for these tests
should _NOT_ be used in production.
2021-08-17 16:20:27 +02:00
Stuart Longland 744a6868fe plugins.topic_checking: De-indent logging checks
As pointed out, the `logdog` docs do the checks outside of the context
manager scope, so we should do so as well.
2021-08-17 16:20:27 +02:00
Stuart Longland 2e52b22c2c plugins.topic_checking tests: Run code formatting tool. 2021-08-17 16:20:27 +02:00
Stuart Longland 0760bd7613 plugins.topic_checking tests: Replace DummyLogger with `logdog` plug-in. 2021-08-17 16:20:27 +02:00
Stuart Longland 5ad48d9129 test config: Enable `pytest_logdog` plug-in 2021-08-17 16:20:27 +02:00
Stuart Longland 73db6a3536 plugins.topic_checking tests: Fix tests broken by Enum change. 2021-08-17 16:20:27 +02:00