This commit is contained in:
Mike Place 2016-11-08 19:40:48 +13:00
parent 3e848ad126
commit 610a198322
No known key found for this signature in database
GPG Key ID: 9136F4F13705CFD3

View File

@ -51,10 +51,11 @@ class CacheDictTestCase(TestCase):
# make sure that a get would get a regular old key error
self.assertRaises(KeyError, cd.__getitem__, 'foo')
class CacheContextTestCase(TestCase):
def setUp(self):
context_dir = os.path.join(tempfile.gettempdir(), 'context')
context_dir = os.path.join(tempfile.gettempdir(), 'context')
if os.path.exists(context_dir):
shutil.rmtree(os.path.join(tempfile.gettempdir(), 'context'))
@ -63,7 +64,7 @@ class CacheContextTestCase(TestCase):
Smoke test the context cache
'''
if os.path.exists(os.path.join(tempfile.gettempdir(), 'context')):
self.skipTest('Context dir already exists')
self.skipTest('Context dir already exists')
else:
opts = salt.config.DEFAULT_MINION_OPTS
opts['cachedir'] = tempfile.gettempdir()
@ -75,7 +76,6 @@ class CacheContextTestCase(TestCase):
self.assertDictEqual({'a': 'b'}, ret)
def test_context_wrapper(self):
'''
Test to ensure that a module which decorates itself
@ -97,7 +97,6 @@ class CacheContextTestCase(TestCase):
self.assertEqual(cache_test_func()['called'], 1)
if __name__ == '__main__':
from integration import run_tests
run_tests(CacheDictTestCase, needs_daemon=False)