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

        @supycache.supycache(cache_key='{somearg}')
        def simple_function(call_count, somearg):
            return call_count % '%d:cached_value'

        simple_function(1, somearg='key')
        self.assertTrue(self.backend.get('key') == '1:cached_value')

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

        simple_function(3, somearg='new_key')
        self.assertTrue(self.backend.get('new_key') == '3:cached_value')
dataset/ETHPy150Open lonetwin/supycache/tests/test_supycache.py/TestCacheDecorators.test_decorator_for_cache_key_keyword_args/swapped operands of `%`