Skip to content

Commit

Permalink
stronger integration score for cli score
Browse files Browse the repository at this point in the history
  • Loading branch information
mgiulini committed Feb 19, 2024
1 parent 42c2c14 commit 6ce7caa
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion integration_tests/test_cli_score.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,25 @@ def test_cli_score():
with redirect_stdout(f):
cli_score.main(pdb_f, tmpdir, full=True, keep_all=False, w_vdw=0.5)
out = f.getvalue().split(os.linesep)
assert out[3].startswith("> HADDOCK-score = (0.5 * vdw) + ")
assert out[4].startswith("> HADDOCK-score = (0.5 * vdw) + ")

# now putting some non-standard emscoring parameters
kwargs_dict = {
"elecflag": "False", # this is a boolean
"epsilon": "2.0", # this is a float
"nemsteps": "100", # this is an int
}
f = io.StringIO()
with redirect_stdout(f):
cli_score.main(pdb_f, tmpdir, full=True, keep_all=False, **kwargs_dict)
out = f.getvalue().split(os.linesep)
print(out)
assert out[0].startswith("* ATTENTION * Value (False) of parameter elecflag different from default")
assert out[1].startswith("* ATTENTION * Value (2.0) of parameter epsilon different from default")
assert out[2].startswith("* ATTENTION * Value (100) of parameter nemsteps different from default")
# check the used parameters
assert out[4].startswith("used emscoring parameters: ")
assert out[4].split("elecflag':")[1].split(",")[0].strip() == "False"

assert out[-3].startswith("> HADDOCK-score (emscoring) = ")

0 comments on commit 6ce7caa

Please sign in to comment.