def test_get_storage(self): envs = { "TSURU_METRICS_BACKEND": "fake", } os.environ.update(envs) stats = Stats("endpoint", "pubsub", 1.0, "ssh_server") storage = stats.get_storage() self.assertIsInstance(storage, FakeBackend)
def test_get_storage(self): envs = { "TSURU_METRICS_BACKEND": "fake", } os.environ.update(envs) stats = Stats("endpoint", "pubsub", 1.0, "ssh_server") storage = stats.get_storage() self.assertIsInstance(storage, FakeBackend)
def test_get_a_not_registered_backend(self): envs = { "TSURU_METRICS_BACKEND": "doesnotexist", } os.environ.update(envs) stats = Stats("endpoint", "pubsub", 1.0, "ssh_server") storage = stats.get_storage() # when a backend does not exists the default should be returned self.assertIsInstance(storage, StatsdBackend)
def test_get_a_not_registered_backend(self): envs = { "TSURU_METRICS_BACKEND": "doesnotexist", } os.environ.update(envs) stats = Stats("endpoint", "pubsub", 1.0, "ssh_server") storage = stats.get_storage() # when a backend does not exists the default should be returned self.assertIsInstance(storage, StatsdBackend)
def test_statsd_default_storage(self): del os.environ["TSURU_METRICS_BACKEND"] stats = Stats("endpoint", "pubsub", 1.0, "ssh_server") storage = stats.get_storage() self.assertIsInstance(storage, StatsdBackend)
def test_statsd_default_storage(self): del os.environ["TSURU_METRICS_BACKEND"] stats = Stats("endpoint", "pubsub", 1.0, "ssh_server") storage = stats.get_storage() self.assertIsInstance(storage, StatsdBackend)