amqtt/tests
lrasku c41b01499d Fix topic filter matching
- re.escape() the whole filter string first to escape _all_ regex
  metacharacters in it, not just $. (# and + are both regex metacharacters,
  so their replace expressions now need a leading \\ to replace the
  escaping, too.)
- # matches topics both with and without a trailing /, so the replace
  expressions adds a '?' before the '.*'. The .lstrip('?') at the end removes
  this in case the # was the first character in the filter.
- + should only match a single level, but it should _also_ match empty levels,
  so use '[^/]*' to replace it.
- Use Regex.fullmatch() to match against the whole topic string, not just
  its start.

Also add two unit tests to test this matching, and fix an incorrect match
against + in test_client_subscribe_publish_dollar_topic_2.
2021-03-15 13:43:47 +01:00
..
mqtt linter project with black at default line length 88 2021-03-15 10:18:00 +01:00
plugins linter project with black at default line length 88 2021-03-15 10:18:00 +01:00
__init__.py use black linter with 96 char line length 2021-03-14 21:44:41 +01:00
conftest.py use black linter with 96 char line length 2021-03-14 21:44:41 +01:00
test_broker.py Fix topic filter matching 2021-03-15 13:43:47 +01:00
test_client.py linter project with black at default line length 88 2021-03-15 10:18:00 +01:00
test_codecs.py use black linter with 96 char line length 2021-03-14 21:44:41 +01:00