Exemplo n.º 1
0
    def test_with_blacklist_items(self):
        expected_pillows = {u'corehq.pillows.case.CasePillow',
                            u'corehq.pillows.xform.XFormPillow',
                            u'corehq.pillows.domain.DomainPillow',
                            u'corehq.pillows.user.UserPillow',
                            u'corehq.pillows.application.AppPillow',
                            u'corehq.pillows.group.GroupPillow',
                            u'corehq.pillows.sms.SMSPillow',
                            u'corehq.pillows.user.GroupToUserPillow',
                            u'corehq.pillows.user.UnknownUsersPillow',
                            u'corehq.pillows.sofabed.FormDataPillow',
                            u'corehq.pillows.sofabed.CaseDataPillow'}

        self.assertEqual(expected_pillows, apply_pillow_actions_to_pillows(
            [{'exclude_groups': ['phonelog']}], self.pillowtops))
Exemplo n.º 2
0
    def test_with_blacklist_items(self):
        expected_pillows = {'CasePillow',
                            'XFormPillow',
                            'DomainPillow',
                            'UserPillow',
                            'AppPillow',
                            'GroupPillow',
                            'SMSPillow',
                            'GroupToUserPillow',
                            'UnknownUsersPillow',
                            'FormDataPillow',
                            'CaseDataPillow',
                            'FakeConstructedPillowName',
                            }

        configs_back = apply_pillow_actions_to_pillows([{'exclude_groups': ['phonelog']}], self.pillowtops)
        self.assertEqual(expected_pillows, set([c.name for c in configs_back]))
Exemplo n.º 3
0
    def test_no_blacklist_items(self):
        expected_pillows = {
            u'corehq.pillows.case.CasePillow',
            u'corehq.pillows.xform.XFormPillow',
            u'corehq.pillows.domain.DomainPillow',
            u'corehq.pillows.user.UserPillow',
            u'corehq.pillows.application.AppPillow',
            u'corehq.pillows.group.GroupPillow',
            u'corehq.pillows.sms.SMSPillow',
            u'corehq.pillows.user.GroupToUserPillow',
            u'corehq.pillows.user.UnknownUsersPillow',
            u'corehq.pillows.sofabed.FormDataPillow',
            u'corehq.pillows.sofabed.CaseDataPillow',
            u'corehq.pillows.log.PhoneLogPillow'
        }

        self.assertEqual(expected_pillows,
                         apply_pillow_actions_to_pillows([], self.pillowtops))