cache_mod.py 369 B

12345678910111213141516171819
  1. # -*- coding: utf-8 -*-
  2. '''
  3. This is a module used in unit.utils.cache to test the context wrapper functions
  4. '''
  5. import salt.utils.cache
  6. def __virtual__():
  7. return True
  8. @salt.utils.cache.context_cache
  9. def test_context_module():
  10. if 'called' in __context__:
  11. __context__['called'] += 1
  12. else:
  13. __context__['called'] = 0
  14. return __context__