Commit 39e25204 authored by Theophile GENTILHOMME's avatar Theophile GENTILHOMME

[test_commands] Change assert to assert_clikc_runner_result

parent 1274fe70
Pipeline #21823 passed with stage
in 19 minutes and 51 seconds
from click.testing import CliRunner
import pkg_resources
from ..script import (pad_commands, vuln_commands)
from bob.extension.scripts.click_helper import assert_click_runner_result
def test_det_pad():
......@@ -13,7 +14,7 @@ def test_det_pad():
result = runner.invoke(pad_commands.det, ['-e', '--output',
'DET.pdf',
licit_dev, licit_test])
assert result.exit_code == 0, (result.exit_code, result.output, result.exception)
assert_click_runner_result(result)
def test_det_vuln():
......@@ -32,7 +33,7 @@ def test_det_vuln():
'DET.pdf',
licit_dev, licit_test,
spoof_dev, spoof_test])
assert result.exit_code == 0, (result.exit_code, result.output, result.exception)
assert_click_runner_result(result)
def test_fmr_iapmr_vuln():
......@@ -50,13 +51,13 @@ def test_fmr_iapmr_vuln():
'--output', 'FMRIAPMR.pdf', licit_dev, licit_test, spoof_dev,
spoof_test
])
assert result.exit_code == 0, (result.exit_code, result.output, result.exception)
assert_click_runner_result(result)
result = runner.invoke(vuln_commands.fmr_iapmr, [
'--output', 'FMRIAPMR.pdf', licit_dev, licit_test, spoof_dev,
spoof_test, '-G', '-L', '1e-7,1,0,1'
])
assert result.exit_code == 0, (result.exit_code, result.output, result.exception)
assert_click_runner_result(result)
def test_hist_pad():
......@@ -71,7 +72,7 @@ def test_hist_pad():
runner = CliRunner()
with runner.isolated_filesystem():
result = runner.invoke(pad_commands.hist, [licit_dev])
assert result.exit_code == 0, (result.exit_code, result.output, result.exception)
assert_click_runner_result(result)
with runner.isolated_filesystem():
result = runner.invoke(pad_commands.hist, ['--criterion', 'min-hter',
......@@ -79,7 +80,7 @@ def test_hist_pad():
'HISTO.pdf', '-b',
'30,20',
licit_dev, spoof_dev])
assert result.exit_code == 0, (result.exit_code, result.output, result.exception)
assert_click_runner_result(result)
with runner.isolated_filesystem():
result = runner.invoke(pad_commands.hist, ['-e', '--criterion', 'eer',
......@@ -87,7 +88,7 @@ def test_hist_pad():
'HISTO.pdf', '-b', '30',
licit_dev, licit_test,
spoof_dev, spoof_test])
assert result.exit_code == 0, (result.exit_code, result.output, result.exception)
assert_click_runner_result(result)
def test_hist_vuln():
......@@ -105,7 +106,7 @@ def test_hist_vuln():
['--criterion', 'eer', '--output',
'HISTO.pdf', '-b', '30', '-ts', 'A,B',
licit_dev, licit_test])
assert result.exit_code == 0, (result.exit_code, result.output, result.exception)
assert_click_runner_result(result)
with runner.isolated_filesystem():
result = runner.invoke(vuln_commands.hist,
......@@ -113,7 +114,7 @@ def test_hist_vuln():
'HISTO.pdf', '-b', '2,20,30', '-e',
licit_dev, licit_test,
spoof_dev, spoof_test])
assert result.exit_code == 0, (result.exit_code, result.output, result.exception)
assert_click_runner_result(result)
def test_metrics_pad():
......@@ -127,7 +128,7 @@ def test_metrics_pad():
pad_commands.metrics,
['-e', licit_dev, licit_test]
)
assert result.exit_code == 0, (result.exit_code, result.output, result.exception)
assert_click_runner_result(result)
def test_epc_vuln():
......@@ -145,13 +146,13 @@ def test_epc_vuln():
['--output', 'epc.pdf',
licit_dev, licit_test,
spoof_dev, spoof_test])
assert result.exit_code == 0, (result.exit_code, result.output, result.exception)
assert_click_runner_result(result)
result = runner.invoke(vuln_commands.epc,
['--output', 'epc.pdf', '-I',
licit_dev, licit_test,
spoof_dev, spoof_test])
assert result.exit_code == 0, (result.exit_code, result.output, result.exception)
assert_click_runner_result(result)
def test_epsc_vuln():
......@@ -169,14 +170,14 @@ def test_epsc_vuln():
['--output', 'epsc.pdf',
licit_dev, licit_test,
spoof_dev, spoof_test])
assert result.exit_code == 0, (result.exit_code, result.output, result.exception)
assert_click_runner_result(result)
result = runner.invoke(vuln_commands.epsc,
['--output', 'epsc.pdf', '-I',
'-fp', '0.1,0.3',
licit_dev, licit_test,
spoof_dev, spoof_test])
assert result.exit_code == 0, (result.exit_code, result.output, result.exception)
assert_click_runner_result(result)
def test_epsc_3D_vuln():
licit_dev = pkg_resources.resource_filename('bob.pad.base.test',
......@@ -193,14 +194,14 @@ def test_epsc_3D_vuln():
['--output', 'epsc.pdf', '-D',
licit_dev, licit_test,
spoof_dev, spoof_test])
assert result.exit_code == 0, (result.exit_code, result.output, result.exception)
assert_click_runner_result(result)
result = runner.invoke(vuln_commands.epsc,
['--output', 'epsc.pdf', '-D',
'-I', '--no-wer',
licit_dev, licit_test,
spoof_dev, spoof_test])
assert result.exit_code == 0, (result.exit_code, result.output, result.exception)
assert_click_runner_result(result)
def test_evaluate_pad():
......@@ -216,4 +217,4 @@ def test_evaluate_pad():
with runner.isolated_filesystem():
result = runner.invoke(pad_commands.evaluate,
[licit_dev, licit_test, spoof_dev, spoof_test])
assert result.exit_code == 0, (result.exit_code, result.output, result.exception)
assert_click_runner_result(result)
Markdown is supported
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