Exemplo n.º 1
0
    def test_india_server_exclusions(self):
        self.pillowtops['fluff'] = [
            'custom.bihar.models.CareBiharFluffPillow',
            'custom.opm.models.OpmCaseFluffPillow',
            'custom.opm.models.OpmUserFluffPillow',
        ]

        reject = Command.get_rejected_pillow_types(os.path.join(self.here, '..', '..', '..'), 'india')
        pillows = Command.get_pillows_from_settings(self.pillowtops, reject)
        has_bihar_pillow = False
        for pillow in pillows:
            assert pillow != 'custom.opm.models.OpmCaseFluffPillow'
            if pillow == 'custom.bihar.models.CareBiharFluffPillow':
                has_bihar_pillow = True
        assert has_bihar_pillow
Exemplo n.º 2
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, Command.get_pillows_from_settings(self.pillowtops))
Exemplo n.º 3
0
    def test_loading_no_existing_conf_file(self):
        expected_reject = {}

        reject = Command.get_rejected_pillow_types(os.path.join(self.here, '..', '..', '..'), 'production')
        self.assertEqual(reject, expected_reject)
Exemplo n.º 4
0
    def test_loading_existing_conf_file(self):
        expected_reject = {'pillowtop_blacklist': ['fluff']}

        reject = Command.get_rejected_pillow_types(os.path.join(self.here, '..', '..', '..'), 'staging')
        self.assertEqual(reject, expected_reject)