Ejemplo n.º 1
0
    def test_missing_required_settings(self):
        from pyramid_bimt import check_required_settings

        with self.assertRaises(KeyError) as cm:
            check_required_settings(self.config_missing)

        self.assertIn('bimt.app_name', cm.exception.message)
Ejemplo n.º 2
0
    def test_check_required_settings(self):
        from pyramid_bimt import check_required_settings

        try:
            check_required_settings(self.config_full)
        except KeyError as ke:  # pragma: no cover
            self.fail(ke.message)
Ejemplo n.º 3
0
    def test_check_required_settings_production(self, patched_sys):
        from pyramid_bimt import check_required_settings

        self.config_full_production.registry.settings['bimt.mode'] = \
            Modes.production.name

        try:
            check_required_settings(self.config_full_production)
        except KeyError as ke:  # pragma: no cover
            self.fail(ke.message)
Ejemplo n.º 4
0
    def test_missing_required_settings_production(self, patched_sys):
        from pyramid_bimt import check_required_settings

        self.config_full.registry.settings['bimt.mode'] = \
            Modes.production.name

        with self.assertRaises(KeyError) as cm:
            check_required_settings(self.config_full)

        self.assertIn('bimt.jvzoo_secret_key', cm.exception.message)
Ejemplo n.º 5
0
 def test_empty_required_settings(self):
     from pyramid_bimt import check_required_settings
     with self.assertRaises(KeyError):
         check_required_settings(self.config_empty)
Ejemplo n.º 6
0
 def test_empty_required_settings_production(self, patched_sys):
     from pyramid_bimt import check_required_settings
     patched_sys.argv = ['pserve', 'production.ini']
     with self.assertRaises(KeyError):
         check_required_settings(self.config_empty)