From 30b9dc8ef43777fa8c30e50d8e267c8440afac40 Mon Sep 17 00:00:00 2001
From: Guillaume HEUSCH <guillaume.heusch@idiap.ch>
Date: Wed, 23 Jan 2019 16:39:16 +0100
Subject: [PATCH] [database] added test for casiasurf

---
 bob/pad/face/test/test_databases.py | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/bob/pad/face/test/test_databases.py b/bob/pad/face/test/test_databases.py
index 38fe4510..3ed90510 100644
--- a/bob/pad/face/test/test_databases.py
+++ b/bob/pad/face/test/test_databases.py
@@ -200,3 +200,22 @@ def test_aggregated_db():
             "The database could not be queried; probably the db.sql3 file is missing. Here is the error: '%s'"
             % e)
 
+
+# Test the casiasurf database
+@db_available('casiasurf')
+def test_casiasurf():
+    casiasurf = bob.bio.base.load_resource(
+        'casiasurf',
+        'database',
+        preferred_package='bob.pad.face',
+        package_prefix='bob.pad.')
+    try:
+        assert len(casiasurf.objects(groups=['train', 'dev'], purposes='real')) == 8942 
+        assert len(casiasurf.objects(groups=['train'], purposes='attack')) == 20324
+        assert len(casiasurf.objects(groups=['dev'], purposes='real')) == 0
+        assert len(casiasurf.objects(groups=['dev'], purposes='attack')) == 9608 
+        
+    except IOError as e:
+        raise SkipTest(
+            "The database could not be queried; probably the db.sql3 file is missing. Here is the error: '%s'"
+            % e)
-- 
GitLab