示例#1
0
 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')
示例#2
0
 def test_statsd_is_called_if_statsd_url_is_set(self, mocked):
     initialization.setup_statsd(self.config)
     mocked.assert_called_with('host', 8080, 'cliquet')
示例#3
0
 def test_statsd_is_set_on_storage(self, mocked):
     c = initialization.setup_statsd(self.config)
     c.watch_execution_time.assert_any_call({}, prefix='storage')
示例#4
0
 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')
示例#5
0
 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()
示例#6
0
 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)
示例#7
0
 def test_statsd_is_set_on_permission(self, mocked):
     c = initialization.setup_statsd(self.config)
     c.watch_execution_time.assert_any_call({}, prefix='permission')
示例#8
0
 def test_statsd_is_called_if_statsd_url_is_set(self, mocked):
     initialization.setup_statsd(self.config)
     mocked.assert_called_with('host', 8080, 'cliquet')
示例#9
0
 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)
示例#10
0
 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()
示例#11
0
 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)
示例#12
0
 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)