Commit 69375ac5 authored by Yannick DAYER's avatar Yannick DAYER

Add back VoxForge database test remove dummy

parent 11ea44cb
Pipeline #51824 failed with stage
in 7 minutes and 19 seconds
include README.rst bootstrap-buildout.py buildout.cfg develop.cfg COPYING version.txt requirements.txt
recursive-include doc *.py *.rst
recursive-include bob/bio/spear/test/data *.hdf5 *.wav *.tar.gz
recursive-include bob/bio/spear/test/data *.hdf5 *.wav
recursive-include bob/bio/spear/config/database *.py *.lst
......@@ -26,6 +26,8 @@ import bob.bio.base
from bob.bio.base.test.test_database_implementations import check_database
from bob.bio.base.test.test_database_implementations import check_database_zt
from bob.bio.base.test.utils import db_available
from bob.pipelines import DelayedSample
from bob.pipelines import SampleSet
@db_available("mobio")
......@@ -143,3 +145,29 @@ def test_timit():
"The database could not queried; probably the db.sql3 file is missing. Here is the error: '%s'"
% e
)
def test_voxforge():
database = bob.bio.base.load_resource(
"voxforge", "database", preferred_package="bob.bio.spear"
)
dev_ref = database.references(group="dev")
eval_ref = database.references(group="eval")
dev_pro = database.probes(group="dev")
eval_pro = database.probes(group="eval")
train = database.background_model_samples()
assert len(dev_ref) == 10, len(dev_ref)
assert all(isinstance(s, SampleSet) for s in dev_ref)
assert all(isinstance(s, DelayedSample) for s in dev_ref[0])
assert len(dev_pro) == 300, len(dev_pro)
assert all(len(s) == 1 for s in dev_pro)
assert all(isinstance(s[0], DelayedSample) for s in dev_pro)
assert len(dev_ref) == 10, len(eval_ref)
assert all(isinstance(s, SampleSet) for s in eval_ref)
assert all(isinstance(s, DelayedSample) for s in eval_ref[0])
assert len(eval_pro) == 300, len(eval_pro)
assert all(len(s) == 1 for s in eval_pro)
assert all(isinstance(s[0], DelayedSample) for s in eval_pro)
assert len(train) == 3148, len(train)
#!/usr/bin/env python
# @author: Yannick Dayer <yannick.dayer@idiap.ch>
# @date: Tue 22 Jun 2021 14:53:03 UTC+02
from pathlib import Path
import pkg_resources
from click.testing import CliRunner
from bob.bio.spear.database.voxforge import download_voxforge
from bob.extension.scripts.click_helper import assert_click_runner_result
def test_download_voxforge():
dataset_protocol = pkg_resources.resource_filename(
"bob.bio.spear.test", "data/dummy_dataset.tar.gz"
)
runner = CliRunner()
with runner.isolated_filesystem():
result = runner.invoke(
download_voxforge,
args=[
"--protocol-definition",
dataset_protocol,
"dummy_files",
],
)
assert_click_runner_result(result)
result_path = Path("dummy_files")
assert result_path.exists()
assert (result_path / "Dcoetzee-20110429-bne.tgz").exists()
assert (result_path / "Dcoetzee-20110429-bne").exists()
assert len(list(result_path.iterdir())) == 20
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