Commit c6eb6e03 authored by Paul McCarthy's avatar Paul McCarthy 🚵
Browse files

TEST: Make sure --forced install is aborted if destination is based on unset

environment variable
parent eb8e9f20
......@@ -687,3 +687,19 @@ def test_main_default_destinations():
shutil.rmtree('defdest')
shutil.rmtree('a')
shutil.rmtree('c')
def test_main_abort_bad_destination():
with tempdir() as cwd:
manifest = [
{'name' : 'abc',
'url' : 'abc.zip',
'destination' : '$UNSET/bin'}
]
with open('manifest.json', 'wt') as f:
f.write(json.dumps(manifest))
with pytest.raises(SystemExit) as e:
with mock.patch.dict(os.environ, clear=True):
fam.main('-m manifest.json -f abc'.split())
assert e.value.code != 0
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment