Esempio n. 1
0
    def test_check_not_required_supported_option(self):
        options = {
            'exporter_options': {
                'LOG_LEVEL': 'DEBUG',
                'LOGGER_NAME': 'export-pipeline'
            },
            'options': {}
        }

        test_notifier = BaseNotifier(options, {})
        test_notifier.supported_options['test'] = {'type': int, 'default': 5}
        test_notifier.check_options()
 def test_check_bad_type_required_supported_option(self):
     options = {
         'exporter_options': {
             'LOG_LEVEL': 'DEBUG',
             'LOGGER_NAME': 'export-pipeline'
         },
         'options': {
             "test": 100
         }
     }
     with self.assertRaises(Exception):
         test_notifier = BaseNotifier(options)
         test_notifier.supported_options.append({'name': 'test', 'type': basestring})
         test_notifier.check_options()
    def test_check_not_required_supported_option(self):
        options = {
            'exporter_options': {
                'LOG_LEVEL': 'DEBUG',
                'LOGGER_NAME': 'export-pipeline'
            },
            'options': {

            }
        }

        test_notifier = BaseNotifier(options, {})
        test_notifier.supported_options['test'] = {'type': int, 'default': 5}
        test_notifier.check_options()
Esempio n. 4
0
 def test_check_bad_type_required_supported_option(self):
     options = {
         'exporter_options': {
             'LOG_LEVEL': 'DEBUG',
             'LOGGER_NAME': 'export-pipeline'
         },
         'options': {
             "test": 100
         }
     }
     with self.assertRaises(Exception):
         test_notifier = BaseNotifier(options)
         test_notifier.supported_options.append({
             'name': 'test',
             'type': basestring
         })
         test_notifier.check_options()