Example #1
0
    def test_given_one_group_destination_then_returns_list_with_one_group_destination(
            self):
        group_row = self.add_group()
        func_key = self.prepare_destination('group', group_row.id)

        result = dao.find_all_by_destination('group', group_row.id)
        assert_that(result, contains(func_key))
Example #2
0
    def test_given_one_queue_destination_then_returns_list_with_one_queue_destination(
            self):
        queue_row = self.add_queuefeatures()
        func_key = self.prepare_destination('queue', queue_row.id)

        result = dao.find_all_by_destination('queue', queue_row.id)
        assert_that(result, contains(func_key))
Example #3
0
    def test_given_one_user_destination_then_returns_list_with_one_element(self):
        user_row = self.add_user()
        func_key = self.prepare_destination('user', user_row.id)

        result = dao.find_all_by_destination('user', user_row.id)

        assert_that(result, contains(func_key))
Example #4
0
    def test_given_one_conference_destination_then_returns_list_with_one_conference_destination(
            self):
        conference_row = self.add_meetmefeatures()
        func_key = self.prepare_destination('conference', conference_row.id)

        result = dao.find_all_by_destination('conference', conference_row.id)
        assert_that(result, contains(func_key))
Example #5
0
    def test_given_user_destination_when_searching_wrong_type_then_returns_empty_list(self):
        user_row = self.add_user()
        self.prepare_destination('user', user_row.id)

        result = dao.find_all_by_destination('invalidtype', user_row.id)

        assert_that(result, contains())
Example #6
0
    def test_given_user_destination_when_searching_wrong_type_then_returns_empty_list(
            self):
        user_row = self.add_user()
        self.prepare_destination('user', user_row.id)

        result = dao.find_all_by_destination('invalidtype', user_row.id)

        assert_that(result, contains())
Example #7
0
    def test_given_one_user_destination_then_returns_list_with_one_element(
            self):
        user_row = self.add_user()
        func_key = self.prepare_destination('user', user_row.id)

        result = dao.find_all_by_destination('user', user_row.id)

        assert_that(result, contains(func_key))
Example #8
0
    def test_given_group_and_user_destination_then_returns_list_with_right_destination(self):
        user_row = self.add_user()
        self.prepare_destination('user', user_row.id)
        group_row = self.add_group()
        group_func_key = self.prepare_destination('group', group_row.id)

        result = dao.find_all_by_destination('group', group_row.id)
        assert_that(result, contains(group_func_key))
Example #9
0
    def test_given_group_and_user_destination_then_returns_list_with_right_destination(
            self):
        user_row = self.add_user()
        self.prepare_destination('user', user_row.id)
        group_row = self.add_group()
        group_func_key = self.prepare_destination('group', group_row.id)

        result = dao.find_all_by_destination('group', group_row.id)
        assert_that(result, contains(group_func_key))
Example #10
0
    def test_given_one_service_destination_then_returns_list_with_one_service_destination(self):
        service_row = self.add_extension(type='extenfeatures',
                                         context='xivo-features',
                                         typeval='vmusermsg')
        func_key = self.prepare_destination('service', service_row.id)

        result = dao.find_all_by_destination('service', service_row.id)

        assert_that(result, contains(func_key))
Example #11
0
    def test_given_one_service_destination_then_returns_list_with_one_service_destination(
            self):
        service_row = self.add_extension(type='extenfeatures',
                                         context='xivo-features',
                                         typeval='vmusermsg')
        func_key = self.prepare_destination('service', service_row.id)

        result = dao.find_all_by_destination('service', service_row.id)

        assert_that(result, contains(func_key))
Example #12
0
    def test_given_2_user_destinations_then_returns_list_with_right_destination(self):
        first_user = self.add_user()
        second_user = self.add_user()

        self.prepare_destination('user', first_user.id)
        func_key = self.prepare_destination('user', second_user.id)

        result = dao.find_all_by_destination('user', second_user.id)

        assert_that(result, contains(func_key))
Example #13
0
    def test_given_2_user_destinations_then_returns_list_with_right_destination(
            self):
        first_user = self.add_user()
        second_user = self.add_user()

        self.prepare_destination('user', first_user.id)
        func_key = self.prepare_destination('user', second_user.id)

        result = dao.find_all_by_destination('user', second_user.id)

        assert_that(result, contains(func_key))
Example #14
0
    def test_given_one_group_destination_then_returns_list_with_one_group_destination(self):
        group_row = self.add_group()
        func_key = self.prepare_destination('group', group_row.id)

        result = dao.find_all_by_destination('group', group_row.id)
        assert_that(result, contains(func_key))
Example #15
0
    def test_given_one_queue_destination_then_returns_list_with_one_queue_destination(self):
        queue_row = self.add_queuefeatures()
        func_key = self.prepare_destination('queue', queue_row.id)

        result = dao.find_all_by_destination('queue', queue_row.id)
        assert_that(result, contains(func_key))
Example #16
0
    def test_given_no_destinations_then_returns_empty_list(self):
        result = dao.find_all_by_destination('user', 1)

        assert_that(result, contains())
Example #17
0
    def test_given_one_conference_destination_then_returns_list_with_one_conference_destination(self):
        conference_row = self.add_meetmefeatures()
        func_key = self.prepare_destination('conference', conference_row.id)

        result = dao.find_all_by_destination('conference', conference_row.id)
        assert_that(result, contains(func_key))
Example #18
0
def delete_user_destination(user):
    func_keys = func_key_dao.find_all_by_destination('user', user.id)
    for func_key in func_keys:
        template_dao.remove_func_key_from_templates(func_key)
        func_key_dao.delete(func_key)
Example #19
0
    def test_given_no_destinations_then_returns_empty_list(self):
        result = dao.find_all_by_destination('user', 1)

        assert_that(result, contains())