diff --git a/bob/bio/base/test/test_scripts.py b/bob/bio/base/test/test_scripts.py index cfaddc437f3b59fc6efb0518635424fdbbea2009..ec918b33bb535136435b3564a876ad121d2c9d27 100644 --- a/bob/bio/base/test/test_scripts.py +++ b/bob/bio/base/test/test_scripts.py @@ -1,13 +1,12 @@ -from __future__ import print_function - import bob.measure import os import shutil import tempfile import numpy +import nose import bob.io.image import bob.bio.base @@ -76,8 +75,6 @@ def test_verify_config(): '--result-directory', test_dir ] - print (bob.bio.base.tools.command_line(parameters)) - _verify(parameters, test_dir, 'test_config') @@ -95,8 +92,6 @@ def test_verify_algorithm_noprojection(): '--result-directory', test_dir ] - print (bob.bio.base.tools.command_line(parameters)) - _verify(parameters, test_dir, 'algorithm_noprojection') @@ -116,8 +111,6 @@ def test_verify_resources(): '--preferred-package', 'bob.bio.base' ] - print (bob.bio.base.tools.command_line(parameters)) - _verify(parameters, test_dir, 'test_resource') @@ -136,8 +129,6 @@ def test_verify_commandline(): '--imports', 'bob.bio.base.test.dummy' ] - print (bob.bio.base.tools.command_line(parameters)) - _verify(parameters, test_dir, 'test_commandline') @@ -164,8 +155,6 @@ def test_verify_parallel(): '--preferred-package', 'bob.bio.base' ] - print (bob.bio.base.tools.command_line(parameters)) - _verify(parameters, test_dir, 'test_parallel') @@ -185,8 +174,6 @@ def test_verify_compressed(): '--preferred-package', 'bob.bio.base' ] - print (bob.bio.base.tools.command_line(parameters)) - _verify(parameters, test_dir, 'test_compressed', score_modifier=('scores', '.tar.bz2')) @@ -206,8 +193,6 @@ def test_verify_calibrate(): '--preferred-package', 'bob.bio.base' ] - print (bob.bio.base.tools.command_line(parameters)) - _verify(parameters, test_dir, 'test_calibrate', '-calibrated', score_modifier=('calibrated', '')) @@ -227,8 +212,6 @@ def test_verify_fileset(): '--imports', 'bob.bio.base.test.dummy' ] - print (bob.bio.base.tools.command_line(parameters)) - _verify(parameters, test_dir, 'test_fileset', ref_modifier="-fileset") @@ -249,8 +232,6 @@ def test_verify_missing(): '--imports', 'bob.bio.base.test.dummy' ] - print (bob.bio.base.tools.command_line(parameters)) - try: from bob.bio.base.script.verify import main main(parameters) @@ -273,6 +254,29 @@ def test_verify_missing(): shutil.rmtree(test_dir) +def test_internal_raises(): + test_dir = tempfile.mkdtemp(prefix='bobtest_') + # define dummy parameters + parameters = [ + '-d', 'dummy', + '-p', 'dummy', + '-e', 'dummy', + '-a', 'dummy', + '-vs', 'test_raises', + '--temp-directory', test_dir, + '--result-directory', test_dir, + '--preferred-package', 'bob.bio.base', + '--imports', 'bob.bio.base.test.dummy' + ] + + from bob.bio.base.script.verify import main + for option, value in (("--group", "dev"), ("--model-type", "N"), ("--score-type", "A")): + internal = parameters + [option, value] + + nose.tools.assert_raises(ValueError, main, internal) + shutil.rmtree(test_dir) + + def test_fusion(): # tests that the fuse_scores script is doing something useful test_dir = tempfile.mkdtemp(prefix='bobtest_')