From 1632b4b078d2300e815752c0406cbf3579cbe136 Mon Sep 17 00:00:00 2001 From: Hossein Shafagh Date: Fri, 18 Sep 2020 21:58:53 -0700 Subject: [PATCH] making lint happy, running make test-python doesn't run lint --- docker/src/lemur.conf.py | 8 ++++---- lemur/tests/conf.py | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/docker/src/lemur.conf.py b/docker/src/lemur.conf.py index 69f9d985..2a4ef514 100644 --- a/docker/src/lemur.conf.py +++ b/docker/src/lemur.conf.py @@ -11,10 +11,10 @@ debug = os.environ.get("DEBUG") == "True" def get_random_secret(length): - secret_key = ''.join(random.choice(string.ascii_uppercase) for x in range(round(length/4))) - secret_key = secret_key + ''.join(random.choice("~!@#$%^&*()_+") for x in range(round(length/4))) - secret_key = secret_key + ''.join(random.choice(string.ascii_lowercase) for x in range(round(length/4))) - return secret_key + ''.join(random.choice(string.digits) for x in range(round(length/4))) + secret_key = ''.join(random.choice(string.ascii_uppercase) for x in range(round(length / 4))) + secret_key = secret_key + ''.join(random.choice("~!@#$%^&*()_+") for x in range(round(length / 4))) + secret_key = secret_key + ''.join(random.choice(string.ascii_lowercase) for x in range(round(length / 4))) + return secret_key + ''.join(random.choice(string.digits) for x in range(round(length / 4))) soi SECRET_KEY = repr(os.environ.get('SECRET_KEY', get_random_secret(32).encode('utf8'))) diff --git a/lemur/tests/conf.py b/lemur/tests/conf.py index f984aeba..d3badbeb 100644 --- a/lemur/tests/conf.py +++ b/lemur/tests/conf.py @@ -1,19 +1,19 @@ # This is just Python which means you can inherit and tweak settings +import base64 import os import random import string -import base64 _basedir = os.path.abspath(os.path.dirname(__file__)) # generate random secrets for unittest def get_random_secret(length): - secret_key = ''.join(random.choice(string.ascii_uppercase) for x in range(round(length/4))) - secret_key = secret_key + ''.join(random.choice("~!@#$%^&*()_+") for x in range(round(length/4))) - secret_key = secret_key + ''.join(random.choice(string.ascii_lowercase) for x in range(round(length/4))) - return secret_key + ''.join(random.choice(string.digits) for x in range(round(length/4))) + secret_key = ''.join(random.choice(string.ascii_uppercase) for x in range(round(length / 4))) + secret_key = secret_key + ''.join(random.choice("~!@#$%^&*()_+") for x in range(round(length / 4))) + secret_key = secret_key + ''.join(random.choice(string.ascii_lowercase) for x in range(round(length / 4))) + return secret_key + ''.join(random.choice(string.digits) for x in range(round(length / 4))) THREADS_PER_PAGE = 8