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