示例#1
0
    def test_get_conversation_reference_should_return_valid_reference(self):
        reference = BotContext.get_conversation_reference(ACTIVITY)

        assert reference.activity_id == ACTIVITY.id
        assert reference.user == ACTIVITY.from_property
        assert reference.bot == ACTIVITY.recipient
        assert reference.conversation == ACTIVITY.conversation
        assert reference.channel_id == ACTIVITY.channel_id
        assert reference.service_url == ACTIVITY.service_url
示例#2
0
    def test_apply_conversation_reference_when_is_incoming_is_True_should_not_prepare_a_reply(
            self):
        reference = BotContext.get_conversation_reference(ACTIVITY)
        reply = BotContext.apply_conversation_reference(
            Activity(type='message', text='reply'), reference, True)

        assert reply.recipient == ACTIVITY.recipient
        assert reply.from_property == ACTIVITY.from_property
        assert reply.conversation == ACTIVITY.conversation
        assert reply.service_url == ACTIVITY.service_url
        assert reply.channel_id == ACTIVITY.channel_id