Some documentation

This commit is contained in:
Felipe M 2020-12-14 23:25:48 +01:00
parent c8c5fefabc
commit 49a9fccbf3
Signed by: fmartingr
GPG key ID: 716BC147715E716F
4 changed files with 70 additions and 24 deletions

16
tests/test_objects.py Normal file
View file

@ -0,0 +1,16 @@
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")