* Added base admin login/logout flows * Ignore local database * Channel model * Admin interface for channels and plugins * Added database tests along with workflows * Added some docstrings * Ignore .coverage file * Creating plugins docs WIP * Documentation * Black everything * Some documentation * Coverage for the plugins package as well * DB Fixes * Absolute FROM in Dockerfile * Database and logging fixes * Slack: Support private channels * Added pre-commit * black'd * Fixed UserQuery.create * Fixed ChannelPluginQuery.create exists call * Added ChannelPlugin menu for debugging * Ignore sqlite databases * Updated contributing docs
18 lines
619 B
Python
18 lines
619 B
Python
from butterrobot.objects import Channel, ChannelPlugin
|
|
|
|
|
|
def test_channel_has_enabled_plugin_ok():
|
|
channel = Channel(
|
|
platform="debug",
|
|
platform_channel_id="debug",
|
|
channel_raw={},
|
|
plugins={
|
|
"enabled": ChannelPlugin(
|
|
id=1, channel_id="test", plugin_id="enabled", enabled=True
|
|
),
|
|
"existant": ChannelPlugin(id=2, channel_id="test", plugin_id="existant"),
|
|
},
|
|
)
|
|
assert not channel.has_enabled_plugin("non.existant")
|
|
assert not channel.has_enabled_plugin("existant")
|
|
assert channel.has_enabled_plugin("enabled")
|