def test_bad_metric_skip(self, LOG): cfg = { 'metric': [ dict(name='test1', type='gauge', unit='B', snmp_inspector={}), dict(name='test_bad', type='invalid', unit='B', snmp_inspector={}), dict(name='test2', type='gauge', unit='B', snmp_inspector={}) ] } data = generic.load_definition(cfg) self.assertEqual(2, len(data)) LOG.error.assert_called_with("Error loading meter definition : " "Unrecognized type value invalid")
def test_bad_metric_skip(self, LOG): cfg = {'metric': [dict(name='test1', type='gauge', unit='B', snmp_inspector={}), dict(name='test_bad', type='invalid', unit='B', snmp_inspector={}), dict(name='test2', type='gauge', unit='B', snmp_inspector={})]} data = generic.load_definition(cfg) self.assertEqual(2, len(data)) LOG.error.assert_called_with( "Error loading meter definition : " "Unrecognized type value invalid")