def test_statsd_is_set_on_authentication(self, mocked): c = initialization.setup_statsd(self.config) c.watch_execution_time.assert_any_call(None, prefix='authentication')
def test_statsd_is_called_if_statsd_url_is_set(self, mocked): initialization.setup_statsd(self.config) mocked.assert_called_with('host', 8080, 'cliquet')
def test_statsd_is_set_on_storage(self, mocked): c = initialization.setup_statsd(self.config) c.watch_execution_time.assert_any_call({}, prefix='storage')
def test_statsd_isnt_called_if_statsd_url_is_not_set(self, mocked): self.config.add_settings({ 'cliquet.statsd_url': None }) initialization.setup_statsd(self.config) mocked.assert_not_called()
def test_statsd_is_expose_in_the_registry_if_url_is_set(self, mocked): initialization.setup_statsd(self.config) self.assertEqual(self.config.registry.statsd, mocked.return_value)
def test_statsd_is_set_on_permission(self, mocked): c = initialization.setup_statsd(self.config) c.watch_execution_time.assert_any_call({}, prefix='permission')
def test_statsd_is_set_to_none_if_statsd_url_not_set(self, mocked): self.config.add_settings({'statsd_url': None}) initialization.setup_statsd(self.config) self.assertEqual(self.config.registry.statsd, None)
def test_statsd_isnt_called_if_statsd_url_is_not_set(self, mocked): self.config.add_settings({'statsd_url': None}) initialization.setup_statsd(self.config) mocked.assert_not_called()
def test_statsd_is_set_to_none_if_statsd_url_not_set(self, mocked): self.config.add_settings({ 'statsd_url': None }) initialization.setup_statsd(self.config) self.assertEqual(self.config.registry.statsd, None)