Skip to content

Commit

Permalink
Altered new test to make it simpler and not effect subsequent tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aidanheerdegen committed May 19, 2020
1 parent db140e2 commit e5ac960
Showing 1 changed file with 7 additions and 18 deletions.
25 changes: 7 additions & 18 deletions test/test_manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,31 +213,19 @@ def test_exe_reproduce():
# Check manifests have changed as expected
assert(not manifests == get_manifests(ctrldir/'manifests'))

# Make an executable in a no-default location
weirdbinpath = bindir / 'weird' / 'model.exe'
weirdbinpath.parent.mkdir(exist_ok=True)
shutil.move(str(bindir/exe), str(weirdbinpath))

config['exe'] = str(weirdbinpath)
write_config(config)

# Run setup with changed exe but reproduce exe set to False
payu_setup(lab_path=str(labdir))

# Reset manifests "truth"
manifests = get_manifests(ctrldir/'manifests')

# Run setup with unchanged exe but reproduce exe set to True.
# Should run without error
payu_setup(lab_path=str(labdir))
# Make exe in config.yaml unfindable by giving it a non-existent name
config['exe'] = 'bogus.exe'

# Change exe back to exe name with no path
config['exe'] = str(exe)
# Change reproduce exe back to False
# Change reproduce exe back to True
config['manifest']['reproduce']['exe'] = True

write_config(config)

# Run setup with changed exe but reproduce exe set to True
# Run setup with changed exe but reproduce exe set to True. Should
# work fine as the exe path is in the manifest
payu_setup(lab_path=str(labdir))

assert(manifests == get_manifests(ctrldir/'manifests'))
Expand All @@ -251,6 +239,7 @@ def test_input_reproduce():
# Set reproduce input to True
config['manifest']['reproduce']['exe'] = False
config['manifest']['reproduce']['input'] = True
config['exe'] = config_orig['exe']
write_config(config)
manifests = get_manifests(ctrldir/'manifests')

Expand Down

0 comments on commit e5ac960

Please sign in to comment.