fixed linter issues (#1538)

main
Andrey Zhavoronkov 6 years ago committed by GitHub
parent d62ae15f77
commit ccd2fbdf51
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -30,7 +30,11 @@ def log_exception(logger=None, exc_info=True):
def get_export_cache_dir(db_task):
return osp.join(db_task.get_task_dirname(), 'export_cache')
task_dir = osp.abspath(db_task.get_task_dirname())
if osp.isdir(task_dir):
return osp.join(task_dir, 'export_cache')
else:
raise Exception('Task dir {} does not exist'.format(task_dir))
DEFAULT_CACHE_TTL = timedelta(hours=10)
CACHE_TTL = DEFAULT_CACHE_TTL

@ -1458,8 +1458,9 @@ class TaskCreateAPITestCase(APITestCase):
def generate_image_file(filename):
f = BytesIO()
width = random.randint(100, 800)
height = random.randint(100, 800)
gen = random.SystemRandom()
width = gen.randint(100, 800)
height = gen.randint(100, 800)
image = Image.new('RGB', size=(width, height))
image.save(f, 'jpeg')
f.name = filename

Loading…
Cancel
Save