def test_decorator_for_cache_key_multi_args_simple(self):
        """ caching a key built from both positional and keyword arguments and returning from cache
        """

        @supycache.supycache(cache_key='{0}_{keyword}')
        def simple_function(positional, call_count, keyword=''):
            return '%d:cached_value' % call_count

        simple_function('some', 1, keyword='key')
        self.assertTrue(self.backend.get('some_key') == '1:cached_value')

        simple_function('some', 2, keyword='key')
        self.assertTrue(self.backend.get('some_key') == '1:cached_value')

        simple_function('some_other', 1, keyword='new_key')
        self.assertTrue(self.backend.get('some_other_new_key') == '1:cached_value')
dataset/ETHPy150Open lonetwin/supycache/tests/test_supycache.py/TestCacheDecorators.test_decorator_for_cache_key_multi_args_simple/original