def test_meters_revno_with_gauge_meter(self): """The service is able to meter a revision by gauge meter.""" service_meter = METER_UTILITY.get_service_meter() with patch.object(service_meter, 'gauge', spec=NamespaceMeter) as gauge: revno() gauge.assert_called_with('revno', version_info['revno'])
def test_meters_revision_by_service(self): """The service is able to meter a revision scoped to services.""" service_meter = METER_UTILITY.get_service_meter() with patch.object(METER_UTILITY, 'get_service_meter'): METER_UTILITY.get_service_meter.return_value = service_meter revno() self.assertTrue(METER_UTILITY.get_service_meter.called)
def test_meters_revno_with_gauge_meter(self): """The service is able to meter a revision by gauge meter.""" service_meter = get_meter('service') with patch.object(service_meter, 'gauge') as gauge: revno() gauge.assert_called_with('revno', version_info['revno'])