From 6e8719b128ba54f78f63b06429198b468a56a632 Mon Sep 17 00:00:00 2001 From: Andrei Date: Wed, 26 Apr 2017 13:20:41 -0700 Subject: [PATCH] Add tests for Channels --- tests/test_channel.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 tests/test_channel.py diff --git a/tests/test_channel.py b/tests/test_channel.py new file mode 100644 index 0000000..56d5227 --- /dev/null +++ b/tests/test_channel.py @@ -0,0 +1,21 @@ +from unittest import TestCase + +from disco.types.channel import Channel, ChannelType + + +class TestChannel(TestCase): + def test_nsfw_channel(self): + channel = Channel( + name='nsfw-testing', + type=ChannelType.GUILD_TEXT) + self.assertTrue(channel.is_nsfw) + + channel = Channel( + name='nsfw-testing', + type=ChannelType.GUILD_VOICE) + self.assertFalse(channel.is_nsfw) + + channel = Channel( + name='nsfw_testing', + type=ChannelType.GUILD_TEXT) + self.assertFalse(channel.is_nsfw)