Ejemplo n.º 1
0
    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'])
Ejemplo n.º 2
0
    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'])
Ejemplo n.º 3
0
    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)
Ejemplo n.º 4
0
    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'])