fix: resolve the seven bugs pinned by the test audit
- read [ignored_tags] instead of [ignored_domains], so tag-based ignoring
actually works
- match ignored tags as whole tags, not substrings ('ipt' no longer matches
'iptorrents')
- send the login-error notification through the Pushover client instead of
the non-existent module-level send_message()
- handle an empty torrent list instead of raising IndexError before any
summary is sent
- tag a new torrent once instead of once per code path
- honour toml_path without DOCKER in AppriseClient
- close replaced log handlers so the file descriptor is released
Also add the missing [telemetry] section to config.toml.example, which
qbit-maid.py requires at startup.
The tests that pinned each bug now assert the fixed behaviour, and the
suite still reports 100% coverage.
This commit is contained in:
1 parent
ab46ea1fb2
commit
d8034278d8
10 files changed
+207
-92
No files matched your search
+9
-6
@@ -113,13 +113,16 @@ class TestPredicates(unittest.TestCase):
|
||||
self.assertTrue(is_ignored_tag(["save"], "save,public,ipt"))
|
||||
self.assertFalse(is_ignored_tag(["save"], "public,ipt"))
|
||||
|
||||
def test_is_ignored_tag_matches_substrings_not_tags(self):
|
||||
"""KNOWN BUG: matching is substring-based, so a short tag matches any
|
||||
longer tag that contains it. 'ipt' matches 'iptorrents' and 'save'
|
||||
matches 'unsaved', which silently ignores unrelated torrents.
|
||||
def test_is_ignored_tag_matches_whole_tags_only(self):
|
||||
"""A configured tag must match a whole tag, not a substring of one.
|
||||
|
||||
'ipt' must not match 'iptorrents' and 'save' must not match 'unsaved'.
|
||||
"""
|
||||
self.assertTrue(is_ignored_tag(["ipt"], "iptorrents"))
|
||||
self.assertTrue(is_ignored_tag(["save"], "unsaved"))
|
||||
self.assertFalse(is_ignored_tag(["ipt"], "iptorrents"))
|
||||
self.assertFalse(is_ignored_tag(["save"], "unsaved"))
|
||||
self.assertTrue(is_ignored_tag(["ipt"], "save,ipt"))
|
||||
self.assertTrue(is_ignored_tag(["save"], " save , public"))
|
||||
self.assertFalse(is_ignored_tag(["save"], ""))
|
||||
|
||||
|
||||
class TestSendPing(unittest.TestCase):
|
||||
|
||||
Reference in new issue
Block a user