def test_decorator_for_cache_key_cached(self):
        """ caching a simple key and return from cache
        """

        @supycache.supycache(cache_key='simple_key')
        def simple_function(call_count):
            return '%d:cached_value' % call_count

        simple_function(1)
        self.assertTrue(self.backend.get('simple_key') == '1:cached_value')

        simple_function(2)
        self.assertTrue(self.backend.get('simple_key') == '1:cached_value')

        simple_function(3)
        self.assertTrue(self.backend.get('simple_key') == '1:cached_value')
dataset/ETHPy150Open lonetwin/supycache/tests/test_supycache.py/TestCacheDecorators.test_decorator_for_cache_key_cached/original