test_utils.py 801 B

123456789101112131415161718192021222324252627282930
  1. from __future__ import absolute_import
  2. from collections import Mapping, MutableMapping
  3. from celery.app.utils import Settings, bugreport
  4. from celery.tests.case import AppCase, Mock
  5. class TestSettings(AppCase):
  6. """
  7. Tests of celery.app.utils.Settings
  8. """
  9. def test_is_mapping(self):
  10. """Settings should be a collections.Mapping"""
  11. self.assertTrue(issubclass(Settings, Mapping))
  12. def test_is_mutable_mapping(self):
  13. """Settings should be a collections.MutableMapping"""
  14. self.assertTrue(issubclass(Settings, MutableMapping))
  15. class test_bugreport(AppCase):
  16. def test_no_conn_driver_info(self):
  17. self.app.connection = Mock()
  18. conn = self.app.connection.return_value = Mock()
  19. conn.transport = None
  20. bugreport(self.app)