def test_channel_fail(self): user = PicklableMock() message = Mock(channel="ch2") user.message = message requirement = ChannelRequirement({"channels": ["ch1"]}) text_normalization_result = None self.assertFalse(requirement.check(text_normalization_result, user))
def test_channel_success(self): user = Mock() message = Mock(channel="ch1") user.message = message requirement = ChannelRequirement({"channels": ["ch1"]}) text_normalization_result = None self.assertTrue(requirement.check(text_normalization_result, user))