예제 #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)
예제 #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)
예제 #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)
예제 #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)
예제 #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)
예제 #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)