Skip to content
Snippets Groups Projects
Commit c4af807c authored by André Anjos's avatar André Anjos :speech_balloon:
Browse files

[test.test_csv] Fix test after changes to stare dataset creation

parent 83e233c3
No related branches found
No related tags found
1 merge request!12Streamlining
Pipeline #39087 passed
......@@ -43,7 +43,8 @@ _root_path = bob.extension.rc.get(
"bob.ip.binseg.stare.datadir", os.path.realpath(os.curdir)
)
def _make_dataset(root_path):
def _make_loader(root_path):
def _loader(context, sample):
# "context" is ignore in this case - database is homogeneous
......@@ -52,10 +53,15 @@ def _make_dataset(root_path):
label=load_pil_1(os.path.join(root_path, sample["label"])),
)
return _loader
def _make_dataset(root_path):
return JSONDataset(
protocols=_protocols,
fieldnames=_fieldnames,
loader=_loader,
loader=_make_loader(root_path),
keymaker=data_path_keymaker,
)
......
......@@ -13,7 +13,7 @@ from ..data import stare
## special trick for CI builds
from . import mock_dataset, TESTDB_TMPDIR
json_dataset, rc_variable_set = mock_dataset()
datadir, json_dataset, rc_variable_set = mock_dataset()
## definition of stare subsets for "default" protocol
......@@ -50,17 +50,10 @@ stare-images/im0324.ppm,labels-ah/im0324.ah.ppm"""
@rc_variable_set("bob.ip.binseg.stare.datadir")
def test_compare_to_json():
if TESTDB_TMPDIR is not None:
stare_dir = TESTDB_TMPDIR.name
else:
import bob.extension
stare_dir = bob.extension.rc.get("bob.ip.binseg.stare.datadir")
test_dataset = CSVDataset(
default,
stare._fieldnames,
stare._make_loader(stare_dir),
stare._make_loader(datadir),
stare.data_path_keymaker,
)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment