Add tests for the last commit

This commit is contained in:
hroff-1902 2019-12-10 00:22:11 +03:00
parent 8431b54b21
commit 18c73ceb90

View File

@ -764,3 +764,25 @@ def test_hyperopt_show(mocker, capsys, hyperopt_results):
start_hyperopt_show(pargs) start_hyperopt_show(pargs)
captured = capsys.readouterr() captured = capsys.readouterr()
assert " 10/12" in captured.out assert " 10/12" in captured.out
args = [
"hyperopt-show",
"--best",
"-n", "-4"
]
pargs = get_args(args)
pargs['config'] = None
with pytest.raises(OperationalException,
match="The index of the epoch to show should be greater than -4."):
start_hyperopt_show(pargs)
args = [
"hyperopt-show",
"--best",
"-n", "4"
]
pargs = get_args(args)
pargs['config'] = None
with pytest.raises(OperationalException,
match="The index of the epoch to show should be less than 4."):
start_hyperopt_show(pargs)