Esempio n. 1
0
 def test_classic_logger_is_used_by_default(self):
     config = testing.setUp()
     config.registry.settings = DEFAULT_SETTINGS
     classiclog_class = mock.patch('kinto.core.logs.ClassicLogRenderer')
     with classiclog_class as mocked:
         initialization.setup_logging(config)
         mocked.assert_called_with(DEFAULT_SETTINGS)
Esempio n. 2
0
 def test_classic_logger_is_used_by_default(self):
     config = testing.setUp()
     config.registry.settings = DEFAULT_SETTINGS
     classiclog_class = mock.patch('kinto.core.logs.ClassicLogRenderer')
     with classiclog_class as mocked:
         initialization.setup_logging(config)
         mocked.assert_called_with(DEFAULT_SETTINGS)
Esempio n. 3
0
    def setUp(self):
        super().setUp()
        config = testing.setUp()
        config.registry.settings = DEFAULT_SETTINGS
        initialization.setup_logging(config)

        patch = mock.patch("kinto.core.initialization.summary_logger")
        self.mocked = patch.start()
        self.addCleanup(patch.stop)
Esempio n. 4
0
    def setUp(self):
        super().setUp()
        config = testing.setUp()
        config.registry.settings = DEFAULT_SETTINGS
        initialization.setup_logging(config)

        patch = mock.patch("kinto.core.initialization.summary_logger")
        self.mocked = patch.start()
        self.addCleanup(patch.stop)
Esempio n. 5
0
    def test_mozlog_logger_is_enabled_via_setting(self):
        mozlog_class = mock.patch('kinto.core.logs.MozillaHekaRenderer')
        classiclog_class = mock.patch('kinto.core.logs.ClassicLogRenderer')

        config = testing.setUp()
        with mock.patch.dict(
                config.registry.settings,
            [('logging_renderer', 'kinto.core.logs.MozillaHekaRenderer')]):
            with mozlog_class as moz_mocked:
                with classiclog_class as classic_mocked:
                    initialization.setup_logging(config)
                    self.assertTrue(moz_mocked.called)
                    self.assertFalse(classic_mocked.called)
Esempio n. 6
0
    def test_mozlog_logger_is_enabled_via_setting(self):
        mozlog_class = mock.patch('kinto.core.logs.MozillaHekaRenderer')
        classiclog_class = mock.patch('kinto.core.logs.ClassicLogRenderer')

        config = testing.setUp()
        with mock.patch.dict(config.registry.settings,
                             [('logging_renderer',
                               'kinto.core.logs.MozillaHekaRenderer')]):
            with mozlog_class as moz_mocked:
                with classiclog_class as classic_mocked:
                    initialization.setup_logging(config)
                    self.assertTrue(moz_mocked.called)
                    self.assertFalse(classic_mocked.called)
Esempio n. 7
0
 def setUp(self):
     super(ResourceInfoTest, self).setUp()
     config = testing.setUp()
     config.registry.settings = DEFAULT_SETTINGS
     initialization.setup_logging(config)
Esempio n. 8
0
 def setUp(self):
     super(ResourceInfoTest, self).setUp()
     config = testing.setUp()
     config.registry.settings = DEFAULT_SETTINGS
     initialization.setup_logging(config)