def test_delete_gauge(self): """Tests deltion of a gauge.""" self.r.delete_gauge("test-gauge") self.redis.assert_has_calls([ call.delete('g:test-gauge'), call.srem(self.r._gauge_slugs_key, "test-gauge"), ])
def test_delete_metric(self): """Verify that ``R.delete_metric`` deletes all keys and removes keys from the set of metric slugs.""" # Make sure KEYS returns some data self.redis.keys.return_value = ["m:slug:0", "m:slug:1"] self.r.delete_metric('slug') # call delete_metric # Verify that the metric data is removed as are the keys from the set self.redis.assert_has_calls([ call.keys("m:slug:*"), call.delete("m:slug:0", "m:slug:1"), call.srem(self.r._metric_slugs_key, "slug") ])