kopia lustrzana https://github.com/Yakifo/amqtt
plugins.topic_checking tests: Fix issues identified by flake8
rodzic
bf5279911b
commit
fed6d2c31c
|
@ -130,7 +130,7 @@ async def test_taboo_empty_config(logdog):
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.asyncio
|
@pytest.mark.asyncio
|
||||||
async def test_taboo_not_taboo_topic(logdog):
|
async def test_taboo_disabled(logdog):
|
||||||
"""
|
"""
|
||||||
Check TopicTabooPlugin returns true if checking disabled.
|
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
|
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.
|
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.
|
Check TopicAccessControlListPlugin returns true if topic checking is disabled.
|
||||||
"""
|
"""
|
||||||
with logdog() as pile:
|
|
||||||
context = BaseContext()
|
context = BaseContext()
|
||||||
context.logger = logging.getLogger("testlog")
|
context.logger = logging.getLogger("testlog")
|
||||||
context.config = {"topic-check": {"enabled": False}}
|
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.
|
Check TopicAccessControlListPlugin returns true if action=publish and no publish-acl given.
|
||||||
(This is for backward-compatibility with existing installations.)
|
(This is for backward-compatibility with existing installations.)
|
||||||
"""
|
"""
|
||||||
with logdog() as pile:
|
|
||||||
context = BaseContext()
|
context = BaseContext()
|
||||||
context.logger = logging.getLogger("testlog")
|
context.logger = logging.getLogger("testlog")
|
||||||
context.config = {"topic-check": {"enabled": True}}
|
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.
|
Check TopicAccessControlListPlugin returns false user there is no topic.
|
||||||
"""
|
"""
|
||||||
with logdog() as pile:
|
|
||||||
context = BaseContext()
|
context = BaseContext()
|
||||||
context.logger = logging.getLogger("testlog")
|
context.logger = logging.getLogger("testlog")
|
||||||
context.config = {
|
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.
|
Check TopicAccessControlListPlugin returns false user is not listed in ACL.
|
||||||
"""
|
"""
|
||||||
with logdog() as pile:
|
|
||||||
context = BaseContext()
|
context = BaseContext()
|
||||||
context.logger = logging.getLogger("testlog")
|
context.logger = logging.getLogger("testlog")
|
||||||
context.config = {
|
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.
|
Check TopicAccessControlListPlugin returns false if "acl" does not list allowed topic.
|
||||||
"""
|
"""
|
||||||
with logdog() as pile:
|
|
||||||
context = BaseContext()
|
context = BaseContext()
|
||||||
context.logger = logging.getLogger("testlog")
|
context.logger = logging.getLogger("testlog")
|
||||||
context.config = {
|
context.config = {
|
||||||
|
@ -446,7 +441,6 @@ async def test_taclp_true_sub_permission(logdog):
|
||||||
"""
|
"""
|
||||||
Check TopicAccessControlListPlugin returns true if "acl" lists allowed topic.
|
Check TopicAccessControlListPlugin returns true if "acl" lists allowed topic.
|
||||||
"""
|
"""
|
||||||
with logdog() as pile:
|
|
||||||
context = BaseContext()
|
context = BaseContext()
|
||||||
context.logger = logging.getLogger("testlog")
|
context.logger = logging.getLogger("testlog")
|
||||||
context.config = {
|
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.
|
Check TopicAccessControlListPlugin returns true if "publish-acl" lists allowed topic for publish action.
|
||||||
"""
|
"""
|
||||||
with logdog() as pile:
|
|
||||||
context = BaseContext()
|
context = BaseContext()
|
||||||
context.logger = logging.getLogger("testlog")
|
context.logger = logging.getLogger("testlog")
|
||||||
context.config = {
|
context.config = {
|
||||||
|
@ -496,7 +489,6 @@ async def test_taclp_true_anon_sub_permission(logdog):
|
||||||
"""
|
"""
|
||||||
Check TopicAccessControlListPlugin handles anonymous users.
|
Check TopicAccessControlListPlugin handles anonymous users.
|
||||||
"""
|
"""
|
||||||
with logdog() as pile:
|
|
||||||
context = BaseContext()
|
context = BaseContext()
|
||||||
context.logger = logging.getLogger("testlog")
|
context.logger = logging.getLogger("testlog")
|
||||||
context.config = {
|
context.config = {
|
||||||
|
|
Ładowanie…
Reference in New Issue