Commit a98b84e9 authored by Tiago de Freitas Pereira's avatar Tiago de Freitas Pereira

Merge branch 'issue-8-remove-database-configuration' into 'master'

[refactoring2016] Added tests for the database interfaces

Solving bob.bio.base#37

See merge request !6
parents ec67437c 539bbc50
Pipeline #3749 passed with stages
in 54 minutes and 58 seconds
......@@ -45,7 +45,7 @@ class BiowaveTestBioDatabase(BioDatabase):
def objects(self, protocol=None, groups=None, purposes=None, model_ids=None, **kwargs):
retval = self.__db.objects(protocol=protocol, groups=groups, purposes=purposes, model_ids=model_ids)
return [VeinBioFile(client_id=f.client_id, path=f.path, file_id=f.file_id) for f in retval]
return [VeinBioFile(client_id=f.client_id, path=f.path, file_id=f.id) for f in retval]
# the methodes are derived from:
# bob.bio.db/bob/bio/db/database.py
......
......@@ -17,7 +17,3 @@ class VeinBioFile(BioFile):
VoxForge database.
"""
super(VeinBioFile, self).__init__(client_id=client_id, path=path, file_id=file_id)
self.__f = f
......@@ -26,4 +26,4 @@ class UtfvpBioDatabase(BioDatabase):
retval = self.__db.objects(groups=groups, protocol=protocol,
purposes=purposes, model_ids=model_ids, **kwargs)
return [VeinBioFile(client_id=f.client_id, path=f.path, file_id=f.file_id) for f in retval]
return [VeinBioFile(client_id=f.client_id, path=f.path, file_id=f.id) for f in retval]
......@@ -44,4 +44,4 @@ class VerafingerBioDatabase(BioDatabase):
self.low_level_group_names, self.high_level_group_names)
retval = self.__db.objects(groups=groups, protocol=protocol,
purposes=purposes, model_ids=model_ids, **kwargs)
return [VeinBioFile(client_id=f.client_id, path=f.path, file_id=f.file_id) for f in retval]
return [VeinBioFile(client_id=f.model_id, path=f.path, file_id=f.id) for f in retval]
#!/usr/bin/env python
# vim: set fileencoding=utf-8 :
# @author: Manuel Guenther <Manuel.Guenther@idiap.ch>
# @date: Thu May 24 10:41:42 CEST 2012
#
# Copyright (C) 2011-2012 Idiap Research Institute, Martigny, Switzerland
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from nose.plugins.skip import SkipTest
import bob.bio.base
from bob.bio.base.test.utils import db_available
from bob.bio.base.test.test_database_implementations import check_database, check_database_zt
@db_available('utfvp')
def test_utfvp():
database = bob.bio.base.load_resource('utfvp', 'database', preferred_package='bob.bio.vein')
try:
check_database(database, protocol='nomLeftRing', groups=('dev', 'eval'))
except IOError as e:
raise SkipTest(
"The database could not queried; probably the db.sql3 file is missing. Here is the error: '%s'" % e)
@db_available('verafinger')
def test_verafinger():
database = bob.bio.base.load_resource('verafinger', 'database', preferred_package='bob.bio.vein')
try:
check_database(database, protocol='Fifty', groups=('dev', 'eval'))
except IOError as e:
raise SkipTest(
"The database could not queried; probably the db.sql3 file is missing. Here is the error: '%s'" % e)
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