X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/4600343d1bff7ac4f7b9f08486541444c31af8b6..0035033f6bf6db955b116e2e0cc052bc5c79d80e:/sdk/python/tests/test_cache.py diff --git a/sdk/python/tests/test_cache.py b/sdk/python/tests/test_cache.py index baa60bfa17..4d68b401ee 100644 --- a/sdk/python/tests/test_cache.py +++ b/sdk/python/tests/test_cache.py @@ -2,14 +2,16 @@ from __future__ import print_function import md5 import mock -import shutil +import os import random +import shutil import sys import tempfile import threading import unittest import arvados.cache +import arvados import run_test_server @@ -47,6 +49,17 @@ class CacheTest(unittest.TestCase): def tearDown(self): shutil.rmtree(self._dir) + def test_cache_create_error(self): + _, filename = tempfile.mkstemp() + home_was = os.environ['HOME'] + os.environ['HOME'] = filename + try: + c = arvados.http_cache('test') + self.assertEqual(None, c) + finally: + os.environ['HOME'] = home_was + os.unlink(filename) + def test_cache_crud(self): c = arvados.cache.SafeHTTPCache(self._dir, max_age=0) url = 'https://example.com/foo?bar=baz'