mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
refactor root directory detection to be cleaner
This commit is contained in:
@ -84,6 +84,20 @@ def test_env_override():
|
||||
assert conf.max_cache_size == 20
|
||||
|
||||
|
||||
def test_root_resists_cwd():
|
||||
previous = os.environ["INVOKEAI_ROOT"]
|
||||
cwd = Path(os.getcwd()).resolve()
|
||||
|
||||
os.environ["INVOKEAI_ROOT"] = "."
|
||||
conf = InvokeAIAppConfig.get_config()
|
||||
conf.parse_args([])
|
||||
assert conf.root_path == cwd
|
||||
|
||||
os.chdir(previous)
|
||||
assert conf.root_path == cwd
|
||||
os.environ["INVOKEAI_ROOT"] = previous
|
||||
|
||||
|
||||
def test_type_coercion():
|
||||
conf = InvokeAIAppConfig().get_config()
|
||||
conf.parse_args(argv=["--root=/tmp/foobar"])
|
||||
|
Reference in New Issue
Block a user