How to use the zulip.integrations.bridge_with_matrix.matrix_bridge.check_zulip_message_validity function in zulip

To help you get started, we’ve selected a few zulip examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github zulip / python-zulip-api / zulip / integrations / bridge_with_matrix / test_matrix.py View on Github external
def test_zulip_message_validity_failure(self):
        # type: () -> None
        zulip_config = self.valid_zulip_config

        msg_wrong_stream = dict(self.valid_msg, display_recipient='foo')
        self.assertFalse(check_zulip_message_validity(msg_wrong_stream, zulip_config))

        msg_wrong_topic = dict(self.valid_msg, subject='foo')
        self.assertFalse(check_zulip_message_validity(msg_wrong_topic, zulip_config))

        msg_not_stream = dict(self.valid_msg, type="private")
        self.assertFalse(check_zulip_message_validity(msg_not_stream, zulip_config))

        msg_from_bot = dict(self.valid_msg, sender_email=zulip_config['email'])
        self.assertFalse(check_zulip_message_validity(msg_from_bot, zulip_config))
github zulip / python-zulip-api / zulip / integrations / bridge_with_matrix / test_matrix.py View on Github external
def test_zulip_message_validity_failure(self):
        # type: () -> None
        zulip_config = self.valid_zulip_config

        msg_wrong_stream = dict(self.valid_msg, display_recipient='foo')
        self.assertFalse(check_zulip_message_validity(msg_wrong_stream, zulip_config))

        msg_wrong_topic = dict(self.valid_msg, subject='foo')
        self.assertFalse(check_zulip_message_validity(msg_wrong_topic, zulip_config))

        msg_not_stream = dict(self.valid_msg, type="private")
        self.assertFalse(check_zulip_message_validity(msg_not_stream, zulip_config))

        msg_from_bot = dict(self.valid_msg, sender_email=zulip_config['email'])
        self.assertFalse(check_zulip_message_validity(msg_from_bot, zulip_config))
github zulip / python-zulip-api / zulip / integrations / bridge_with_matrix / test_matrix.py View on Github external
def test_zulip_message_validity_failure(self):
        # type: () -> None
        zulip_config = self.valid_zulip_config

        msg_wrong_stream = dict(self.valid_msg, display_recipient='foo')
        self.assertFalse(check_zulip_message_validity(msg_wrong_stream, zulip_config))

        msg_wrong_topic = dict(self.valid_msg, subject='foo')
        self.assertFalse(check_zulip_message_validity(msg_wrong_topic, zulip_config))

        msg_not_stream = dict(self.valid_msg, type="private")
        self.assertFalse(check_zulip_message_validity(msg_not_stream, zulip_config))

        msg_from_bot = dict(self.valid_msg, sender_email=zulip_config['email'])
        self.assertFalse(check_zulip_message_validity(msg_from_bot, zulip_config))
github zulip / python-zulip-api / zulip / integrations / bridge_with_matrix / test_matrix.py View on Github external
def test_zulip_message_validity_failure(self):
        # type: () -> None
        zulip_config = self.valid_zulip_config

        msg_wrong_stream = dict(self.valid_msg, display_recipient='foo')
        self.assertFalse(check_zulip_message_validity(msg_wrong_stream, zulip_config))

        msg_wrong_topic = dict(self.valid_msg, subject='foo')
        self.assertFalse(check_zulip_message_validity(msg_wrong_topic, zulip_config))

        msg_not_stream = dict(self.valid_msg, type="private")
        self.assertFalse(check_zulip_message_validity(msg_not_stream, zulip_config))

        msg_from_bot = dict(self.valid_msg, sender_email=zulip_config['email'])
        self.assertFalse(check_zulip_message_validity(msg_from_bot, zulip_config))
github zulip / python-zulip-api / zulip / integrations / bridge_with_matrix / test_matrix.py View on Github external
def test_zulip_message_validity_success(self):
        # type: () -> None
        zulip_config = self.valid_zulip_config
        msg = self.valid_msg
        # Ensure the test inputs are valid for success
        assert msg['sender_email'] != zulip_config['email']

        self.assertTrue(check_zulip_message_validity(msg, zulip_config))