butterrobot/tests/test_objects.py
Felipe Martin Garcia 57b413dd1b
Added admin interface to manage channels and enabled plugins (#9)
* 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
2022-02-05 13:00:20 +01:00

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")