Commits

Wichert Akkerman committed 889102c

Set the name on the CacheRegion. Fixes #27

  • Participants
  • Parent commits c2d8cca

Comments (0)

Files changed (2)

File dogpile/cache/region.py

             async_creation_runner=None,
     ):
         """Construct a new :class:`.CacheRegion`."""
+        self.name = name
         self.function_key_generator = function_key_generator
         if key_mangler:
             self.key_mangler = key_mangler

File tests/cache/test_region.py

         reg.configure(backend, **config_args)
         return reg
 
+    def test_set_name(self):
+        my_region = make_region(name='my-name')
+        eq_(my_region.name, 'my-name')
+
     def test_instance_from_dict(self):
         my_conf = {
             'cache.example.backend': 'mock',