Esempio n. 1
0
    def test_when_searching_with_a_custom_extra_argument(self):
        expected_allow = SearchResult(1, [self.schedule2])
        self.assert_search_returns_result(expected_allow, timezone='bar')

        expected_all_deny = SearchResult(
            3, [self.schedule1, self.schedule3, self.schedule4])
        self.assert_search_returns_result(expected_all_deny, timezone='resto')
Esempio n. 2
0
    def test_when_searching_with_a_custom_extra_argument(self):
        expected_allow = SearchResult(1, [self.paging2])
        self.assert_search_returns_result(expected_allow, announce_sound='bar')

        expected_all_deny = SearchResult(
            3, [self.paging1, self.paging3, self.paging4])
        self.assert_search_returns_result(expected_all_deny,
                                          announce_sound='resto')
Esempio n. 3
0
    def test_when_searching_with_a_custom_extra_argument(self):
        expected_allow = SearchResult(1, [self.skill2])
        self.assert_search_returns_result(expected_allow, description='bar')

        expected_all_deny = SearchResult(
            3, [self.skill1, self.skill3, self.skill4])
        self.assert_search_returns_result(expected_all_deny,
                                          description='resto')
Esempio n. 4
0
    def test_when_searching_with_an_extra_argument(self):
        expected_resto = SearchResult(1, [self.user1])
        self.assert_search_returns_result(expected_resto, search='ou', description='resto')

        expected_bar = SearchResult(1, [self.user2])
        self.assert_search_returns_result(expected_bar, search='ou', description='bar')

        expected_all_resto = SearchResult(3, [self.user1, self.user3, self.user4])
        self.assert_search_returns_result(expected_all_resto, description='resto', order='firstname')
Esempio n. 5
0
    def test_when_searching_with_a_custom_extra_argument(self):
        expected_allow = SearchResult(1, [self.conference2])
        self.assert_search_returns_result(expected_allow,
                                          preprocess_subroutine='bar')

        expected_all_deny = SearchResult(
            3, [self.conference1, self.conference3, self.conference4])
        self.assert_search_returns_result(expected_all_deny,
                                          preprocess_subroutine='resto')
Esempio n. 6
0
    def test_when_searching_with_an_extra_argument(self):
        expected_resto = SearchResult(1, [self.outcall1])
        self.assert_search_returns_result(expected_resto, search='ton', description='resto')

        expected_bar = SearchResult(1, [self.outcall2])
        self.assert_search_returns_result(expected_bar, search='ton', description='bar')

        expected_all_resto = SearchResult(3, [self.outcall1, self.outcall3, self.outcall4])
        self.assert_search_returns_result(expected_all_resto, description='resto', order='preprocess_subroutine')
Esempio n. 7
0
    def test_when_searching_with_an_extra_argument(self):
        expected_resto = SearchResult(1, [self.voicemail1])
        self.assert_search_returns_result(expected_resto, search='ton', context='resto')

        expected_bar = SearchResult(1, [self.voicemail2])
        self.assert_search_returns_result(expected_bar, search='ton', context='bar')

        expected_all_resto = SearchResult(3, [self.voicemail1, self.voicemail3, self.voicemail4])
        self.assert_search_returns_result(expected_all_resto, context='resto', order='name')
Esempio n. 8
0
    def test_when_searching_with_an_extra_argument(self):
        expected_resto = SearchResult(1, [self.parking_lot1])
        self.assert_search_returns_result(expected_resto, search='ton', timeout=111)

        expected_bar = SearchResult(1, [self.parking_lot2])
        self.assert_search_returns_result(expected_bar, search='ton', timeout=222)

        expected_all_resto = SearchResult(3, [self.parking_lot1, self.parking_lot3, self.parking_lot4])
        self.assert_search_returns_result(expected_all_resto, timeout=111, order='name')
Esempio n. 9
0
    def test_when_searching_with_an_extra_argument(self):
        expected_resto = SearchResult(1, [self.call_permission1])
        self.assert_search_returns_result(expected_resto, search='ton', description='resto')

        expected_bar = SearchResult(1, [self.call_permission2])
        self.assert_search_returns_result(expected_bar, search='ton', description='bar')

        expected_all_resto = SearchResult(3, [self.call_permission1, self.call_permission3, self.call_permission4])
        self.assert_search_returns_result(expected_all_resto, description='resto', order='name')
Esempio n. 10
0
    def test_when_searching_with_an_extra_argument(self):
        expected_resto = SearchResult(1, [self.transport1])
        self.assert_search_returns_result(expected_resto,
                                          search='ton',
                                          uuid=self.transport1.uuid)

        expected_bar = SearchResult(1, [self.transport2])
        self.assert_search_returns_result(expected_bar,
                                          search='ton',
                                          uuid=self.transport2.uuid)
Esempio n. 11
0
    def test_when_searching_with_an_extra_argument(self):
        expected_resto = SearchResult(1, [self.moh1])
        self.assert_search_returns_result(expected_resto,
                                          search='ton',
                                          name='resto1')

        expected_bar = SearchResult(1, [self.moh2])
        self.assert_search_returns_result(expected_bar,
                                          search='ton',
                                          name='bar2')
Esempio n. 12
0
    def test_search_multi_tenant(self):
        tenant = self.add_tenant()

        call_pickup1 = self.add_pickup(name='a')
        call_pickup2 = self.add_pickup(name='b', tenant_uuid=tenant.uuid)

        expected = SearchResult(2, [call_pickup1, call_pickup2])
        tenants = [tenant.uuid, self.default_tenant.uuid]
        self.assert_search_returns_result(expected, tenant_uuids=tenants)

        expected = SearchResult(1, [call_pickup2])
        tenants = [tenant.uuid]
        self.assert_search_returns_result(expected, tenant_uuids=tenants)
Esempio n. 13
0
    def test_search_multi_tenant(self):
        tenant = self.add_tenant()

        model_1 = self.add_meeting(name='sort1')
        model_2 = self.add_meeting(name='sort2', tenant_uuid=tenant.uuid)

        expected = SearchResult(2, [model_1, model_2])
        tenants = [tenant.uuid, self.default_tenant.uuid]
        self.assert_search_returns_result(expected, tenant_uuids=tenants)

        expected = SearchResult(1, [model_2])
        tenants = [tenant.uuid]
        self.assert_search_returns_result(expected, tenant_uuids=tenants)
Esempio n. 14
0
    def test_search_multi_tenant(self):
        tenant = self.add_tenant()

        outcall1 = self.add_outcall()
        outcall2 = self.add_outcall(tenant_uuid=tenant.uuid)

        expected = SearchResult(2, [outcall1, outcall2])
        tenants = [tenant.uuid, self.default_tenant.uuid]
        self.assert_search_returns_result(expected, tenant_uuids=tenants)

        expected = SearchResult(1, [outcall2])
        tenants = [tenant.uuid]
        self.assert_search_returns_result(expected, tenant_uuids=tenants)
Esempio n. 15
0
    def test_search_multi_tenant(self):
        tenant = self.add_tenant()

        switchboard1 = self.add_switchboard(name="a")
        switchboard2 = self.add_switchboard(name="b", tenant_uuid=tenant.uuid)

        expected = SearchResult(2, [switchboard1, switchboard2])
        tenants = [tenant.uuid, self.default_tenant.uuid]
        self.assert_search_returns_result(expected, tenant_uuids=tenants)

        expected = SearchResult(1, [switchboard2])
        tenants = [tenant.uuid]
        self.assert_search_returns_result(expected, tenant_uuids=tenants)
Esempio n. 16
0
    def test_search_multi_tenant(self):
        tenant = self.add_tenant()

        trunk1 = self.add_trunk()
        trunk2 = self.add_trunk(tenant_uuid=tenant.uuid)

        expected = SearchResult(2, [trunk1, trunk2])
        tenants = [tenant.uuid, self.default_tenant.uuid]
        self.assert_search_returns_result(expected, tenant_uuids=tenants)

        expected = SearchResult(1, [trunk2])
        tenants = [tenant.uuid]
        self.assert_search_returns_result(expected, tenant_uuids=tenants)
Esempio n. 17
0
    def test_search_multi_tenant(self):
        tenant = self.add_tenant()

        agent1 = self.add_agent()
        agent2 = self.add_agent(tenant_uuid=tenant.uuid)

        expected = SearchResult(2, [agent1, agent2])
        tenants = [tenant.uuid, self.default_tenant.uuid]
        self.assert_search_returns_result(expected, tenant_uuids=tenants)

        expected = SearchResult(1, [agent2])
        tenants = [tenant.uuid]
        self.assert_search_returns_result(expected, tenant_uuids=tenants)
Esempio n. 18
0
    def test_search_multi_tenant(self):
        tenant = self.add_tenant()

        ivr1 = self.add_ivr()
        ivr2 = self.add_ivr(tenant_uuid=tenant.uuid)

        expected = SearchResult(2, [ivr1, ivr2])
        tenants = [tenant.uuid, self.default_tenant.uuid]
        self.assert_search_returns_result(expected, tenant_uuids=tenants)

        expected = SearchResult(1, [ivr2])
        tenants = [tenant.uuid]
        self.assert_search_returns_result(expected, tenant_uuids=tenants)
Esempio n. 19
0
    def test_search_multi_tenant(self):
        tenant = self.add_tenant()

        custom1 = self.add_usercustom(interface='custom/sort1')
        custom2 = self.add_usercustom(interface='custom/sort2', tenant_uuid=tenant.uuid)

        expected = SearchResult(2, [custom1, custom2])
        tenants = [tenant.uuid, self.default_tenant.uuid]
        self.assert_search_returns_result(expected, tenant_uuids=tenants)

        expected = SearchResult(1, [custom2])
        tenants = [tenant.uuid]
        self.assert_search_returns_result(expected, tenant_uuids=tenants)
Esempio n. 20
0
    def test_search_multi_tenant(self):
        tenant = self.add_tenant()

        call_permission1 = self.add_call_permission(name='sort1')
        call_permission2 = self.add_call_permission(name='sort2', tenant_uuid=tenant.uuid)

        expected = SearchResult(2, [call_permission1, call_permission2])
        tenants = [tenant.uuid, self.default_tenant.uuid]
        self.assert_search_returns_result(expected, tenant_uuids=tenants)

        expected = SearchResult(1, [call_permission2])
        tenants = [tenant.uuid]
        self.assert_search_returns_result(expected, tenant_uuids=tenants)
Esempio n. 21
0
    def test_search_multi_tenant(self):
        tenant = self.add_tenant()

        moh1 = self.add_moh(label='moh1')
        moh2 = self.add_moh(label='moh2', tenant_uuid=tenant.uuid)

        expected = SearchResult(2, [moh1, moh2])
        tenants = [tenant.uuid, self.default_tenant.uuid]
        self.assert_search_returns_result(expected, tenant_uuids=tenants)

        expected = SearchResult(1, [moh2])
        tenants = [tenant.uuid]
        self.assert_search_returns_result(expected, tenant_uuids=tenants)
Esempio n. 22
0
    def test_search_multi_tenant(self):
        tenant = self.add_tenant()

        sip1 = self.add_endpoint_sip(label='sort1')
        sip2 = self.add_endpoint_sip(label='sort2', tenant_uuid=tenant.uuid)

        expected = SearchResult(2, [sip1, sip2])
        tenants = [tenant.uuid, self.default_tenant.uuid]
        self.assert_search_returns_result(expected, tenant_uuids=tenants)

        expected = SearchResult(1, [sip2])
        tenants = [tenant.uuid]
        self.assert_search_returns_result(expected, tenant_uuids=tenants)
Esempio n. 23
0
    def test_search_multi_tenant(self):
        tenant = self.add_tenant()

        paging1 = self.add_paging()
        paging2 = self.add_paging(tenant_uuid=tenant.uuid)

        expected = SearchResult(2, [paging1, paging2])
        tenants = [tenant.uuid, self.default_tenant.uuid]
        self.assert_search_returns_result(expected, tenant_uuids=tenants)

        expected = SearchResult(1, [paging2])
        tenants = [tenant.uuid]
        self.assert_search_returns_result(expected, tenant_uuids=tenants)
Esempio n. 24
0
    def test_search_multi_tenant(self):
        tenant = self.add_tenant()

        iax1 = self.add_useriax(name='sort1')
        iax2 = self.add_useriax(name='sort2', tenant_uuid=tenant.uuid)

        expected = SearchResult(2, [iax1, iax2])
        tenants = [tenant.uuid, self.default_tenant.uuid]
        self.assert_search_returns_result(expected, tenant_uuids=tenants)

        expected = SearchResult(1, [iax2])
        tenants = [tenant.uuid]
        self.assert_search_returns_result(expected, tenant_uuids=tenants)
Esempio n. 25
0
    def test_search_multi_tenant(self):
        tenant = self.add_tenant()

        schedule1 = self.add_schedule()
        schedule2 = self.add_schedule(tenant_uuid=tenant.uuid)

        expected = SearchResult(2, [schedule1, schedule2])
        tenants = [tenant.uuid, self.default_tenant.uuid]
        self.assert_search_returns_result(expected, tenant_uuids=tenants)

        expected = SearchResult(1, [schedule2])
        tenants = [tenant.uuid]
        self.assert_search_returns_result(expected, tenant_uuids=tenants)
Esempio n. 26
0
    def test_search_multi_tenant(self):
        tenant = self.add_tenant()

        group1 = self.add_group(label='a')
        group2 = self.add_group(label='b', tenant_uuid=tenant.uuid)

        expected = SearchResult(2, [group1, group2])
        tenants = [tenant.uuid, self.default_tenant.uuid]
        self.assert_search_returns_result(expected, tenant_uuids=tenants)

        expected = SearchResult(1, [group2])
        tenants = [tenant.uuid]
        self.assert_search_returns_result(expected, tenant_uuids=tenants)
Esempio n. 27
0
    def test_search_multi_tenant(self):
        tenant = self.add_tenant()

        conference1 = self.add_conference()
        conference2 = self.add_conference(tenant_uuid=tenant.uuid)

        expected = SearchResult(2, [conference1, conference2])
        tenants = [tenant.uuid, self.default_tenant.uuid]
        self.assert_search_returns_result(expected, tenant_uuids=tenants)

        expected = SearchResult(1, [conference2])
        tenants = [tenant.uuid]
        self.assert_search_returns_result(expected, tenant_uuids=tenants)
Esempio n. 28
0
    def test_search_multi_tenant(self):
        tenant = self.add_tenant()

        template1 = self.add_func_key_template(name='a')
        template2 = self.add_func_key_template(name='b',
                                               tenant_uuid=tenant.uuid)

        expected = SearchResult(2, [template1, template2])
        tenants = [tenant.uuid, self.default_tenant.uuid]
        self.assert_search_returns_result(expected, tenant_uuids=tenants)

        expected = SearchResult(1, [template2])
        tenants = [tenant.uuid]
        self.assert_search_returns_result(expected, tenant_uuids=tenants)
Esempio n. 29
0
    def test_search_multi_tenant(self):
        tenant = self.add_tenant()

        external_app1 = self.add_external_app(name='1')
        external_app2 = self.add_external_app(name='2',
                                              tenant_uuid=tenant.uuid)

        expected = SearchResult(2, [external_app1, external_app2])
        tenants = [tenant.uuid, self.default_tenant.uuid]
        self.assert_search_returns_result(expected, tenant_uuids=tenants)

        expected = SearchResult(1, [external_app2])
        tenants = [tenant.uuid]
        self.assert_search_returns_result(expected, tenant_uuids=tenants)
Esempio n. 30
0
    def test_search_multi_tenant(self):
        tenant = self.add_tenant()
        context1 = self.add_context(tenant_uuid=self.default_tenant.uuid)
        context2 = self.add_context(tenant_uuid=tenant.uuid)

        voicemail1 = self.add_voicemail(mailbox='1001', context=context1.name)
        voicemail2 = self.add_voicemail(mailbox='1002', context=context2.name)

        expected = SearchResult(2, [voicemail1, voicemail2])
        tenants = [tenant.uuid, self.default_tenant.uuid]
        self.assert_search_returns_result(expected, tenant_uuids=tenants, order='number')

        expected = SearchResult(1, [voicemail2])
        tenants = [tenant.uuid]
        self.assert_search_returns_result(expected, tenant_uuids=tenants)