Esempio n. 1
0
    def test_given_no_extension_then_updates_caller_id_and_line(self,
                                                                update_caller_id,
                                                                update_line,
                                                                update_exten_and_context):
        main_user = Mock(User)
        line = Mock(Line)

        ule_service.update_resources(main_user, line)

        update_caller_id.assert_called_once_with(main_user, line, None)
        update_line.assert_called_once_with(main_user, line)
        self.assertNotCalled(update_exten_and_context)
Esempio n. 2
0
    def test_given_extension_associated_then_updates_all_resources(self,
                                                                   update_caller_id,
                                                                   update_line,
                                                                   update_exten_and_context):
        main_user = Mock(User)
        line = Mock(Line)
        extension = Mock(Extension)

        ule_service.update_resources(main_user, line, extension)

        update_caller_id.assert_called_once_with(main_user, line, extension)
        update_line.assert_called_once_with(main_user, line)
        update_exten_and_context.assert_called_once_with(main_user, line, extension)