plugins.topic_checking tests: Fix issues identified by flake8

pull/69/head
Stuart Longland 2021-07-08 10:37:45 +10:00 zatwierdzone przez Florian Ludwig
rodzic bf5279911b
commit fed6d2c31c
1 zmienionych plików z 106 dodań i 114 usunięć

Wyświetl plik

@ -130,7 +130,7 @@ async def test_taboo_empty_config(logdog):
@pytest.mark.asyncio
async def test_taboo_not_taboo_topic(logdog):
async def test_taboo_disabled(logdog):
"""
Check TopicTabooPlugin returns true if checking disabled.
"""
@ -278,7 +278,7 @@ def test_topic_ac_match_exact():
assert TopicAccessControlListPlugin.topic_ac("exact/topic", "exact/topic") is True
def test_topic_ac_match_hash():
def test_topic_ac_match_plus():
"""
Test TopicAccessControlListPlugin.topic_ac correctly handles '+' wildcard.
"""
@ -330,7 +330,6 @@ async def test_taclp_true_disabled(logdog):
"""
Check TopicAccessControlListPlugin returns true if topic checking is disabled.
"""
with logdog() as pile:
context = BaseContext()
context.logger = logging.getLogger("testlog")
context.config = {"topic-check": {"enabled": False}}
@ -351,7 +350,6 @@ async def test_taclp_true_no_pub_acl(logdog):
Check TopicAccessControlListPlugin returns true if action=publish and no publish-acl given.
(This is for backward-compatibility with existing installations.)
"""
with logdog() as pile:
context = BaseContext()
context.logger = logging.getLogger("testlog")
context.config = {"topic-check": {"enabled": True}}
@ -371,7 +369,6 @@ async def test_taclp_false_sub_no_topic(logdog):
"""
Check TopicAccessControlListPlugin returns false user there is no topic.
"""
with logdog() as pile:
context = BaseContext()
context.logger = logging.getLogger("testlog")
context.config = {
@ -396,7 +393,6 @@ async def test_taclp_false_sub_unknown_user(logdog):
"""
Check TopicAccessControlListPlugin returns false user is not listed in ACL.
"""
with logdog() as pile:
context = BaseContext()
context.logger = logging.getLogger("testlog")
context.config = {
@ -421,7 +417,6 @@ async def test_taclp_false_sub_no_permission(logdog):
"""
Check TopicAccessControlListPlugin returns false if "acl" does not list allowed topic.
"""
with logdog() as pile:
context = BaseContext()
context.logger = logging.getLogger("testlog")
context.config = {
@ -446,7 +441,6 @@ async def test_taclp_true_sub_permission(logdog):
"""
Check TopicAccessControlListPlugin returns true if "acl" lists allowed topic.
"""
with logdog() as pile:
context = BaseContext()
context.logger = logging.getLogger("testlog")
context.config = {
@ -471,7 +465,6 @@ async def test_taclp_true_pub_permission(logdog):
"""
Check TopicAccessControlListPlugin returns true if "publish-acl" lists allowed topic for publish action.
"""
with logdog() as pile:
context = BaseContext()
context.logger = logging.getLogger("testlog")
context.config = {
@ -496,7 +489,6 @@ async def test_taclp_true_anon_sub_permission(logdog):
"""
Check TopicAccessControlListPlugin handles anonymous users.
"""
with logdog() as pile:
context = BaseContext()
context.logger = logging.getLogger("testlog")
context.config = {