Added more tests and moved all env and env file testing to classes (it might make more sense to just move them to separate files?).

This commit is contained in:
cwandrews
2017-10-15 16:14:14 -04:00
parent dc34ab4a8b
commit cb7a18f20f
3 changed files with 81 additions and 29 deletions

View File

@ -78,21 +78,17 @@ def read(filename, module, install=False, quiet=False, verbose=False, default_en
raise RuntimeError('UNEXPECTED: argparse should not allow this.')
env_dir = Path(filename).parent or Path(module).parent
if default_env_file:
for f in default_env_file:
env_file_path = env_dir.joinpath(f)
load_dotenv(env_file_path)
if default_env:
for e in default_env:
set_env_var(e)
if env_file:
for f in env_file:
env_file_path = env_dir.joinpath(f)
load_dotenv(env_file_path, override=True)
if env:
for e in env:
set_env_var(e, override=True)