From 7a843df68f210db4121b50af87b68bfaaa65cd2f Mon Sep 17 00:00:00 2001
From: Yannick DAYER <yannick.dayer@idiap.ch>
Date: Fri, 24 Apr 2020 16:56:08 +0200
Subject: [PATCH] [py] Added tests for debug_protocol references len

---
 bob/db/morph/test.py | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/bob/db/morph/test.py b/bob/db/morph/test.py
index 9857a2c..827bea6 100644
--- a/bob/db/morph/test.py
+++ b/bob/db/morph/test.py
@@ -208,7 +208,7 @@ def test_verification_fold1_probes_dev():
         expected_sample_count=1,
         match_sample_count_exactly=False,
         is_probes=True,
-        ref_count=None,
+        ref_count=10540//2,
     )
 
 # -----------------------------------------------------------------------------
@@ -240,7 +240,7 @@ def test_verification_fold1_probes_eval():
         expected_sample_count=1,
         match_sample_count_exactly=False,
         is_probes=True,
-        ref_count=None,
+        ref_count=10540//2,
     )
 
 
@@ -303,9 +303,15 @@ def test_debug_protocol_probes_dev():
         expected_sample_count=1,
         match_sample_count_exactly=False,
         is_probes=True,
-        ref_count=None,
+        ref_count=100,
     )
 
+    ids = [p.subject for p in probes_set_dev]
+    
+    assert len(set(ids)) == 100
+    assert len(set(probes_set_dev[0].references)) == 100
+    assert len(_commons(set(ids), set(probes_set_dev[0].references))) == 100
+
 # -----------------------------------------------------------------------------
 # references eval
 # -----------------------------------------------------------------------------
@@ -335,5 +341,11 @@ def test_debug_protocol_probes_eval():
         expected_sample_count=1,
         match_sample_count_exactly=False,
         is_probes=True,
-        ref_count=None,
+        ref_count=100,
     )
+
+    ids = [p.subject for p in probes_set_eval]
+
+    assert len(set(ids)) == 100
+    assert len(set(probes_set_eval[0].references)) == 100
+    assert len(_commons(set(ids), set(probes_set_eval[0].references))) == 100
-- 
GitLab