From 3dd4c9423e2018c6f1969fb6cd5e136945a05d11 Mon Sep 17 00:00:00 2001 From: Dimitri Yatsenko Date: Thu, 12 Sep 2024 17:39:11 -0500 Subject: [PATCH] add test and change log for #989 --- CHANGELOG.md | 1 + tests/test_autopopulate.py | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 05bfcabd..f22d4825 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - Added - `dj.Top` restriction ([#1024](https://github.com/datajoint/datajoint-python/issues/1024)) PR [#1084](https://github.com/datajoint/datajoint-python/pull/1084) - Fixed - Added encapsulating double quotes to comply with [DOT language](https://graphviz.org/doc/info/lang.html) - PR [#1177](https://github.com/datajoint/datajoint-python/pull/1177) - Added - Ability to set hidden attributes on a table - PR [#1091](https://github.com/datajoint/datajoint-python/pull/1091) +- Added - Ability to specify a list of keys to popuate - PR [#989](https://github.com/datajoint/datajoint-python/pull/989) ### 0.14.2 -- Aug 19, 2024 - Added - Migrate nosetests to pytest - PR [#1142](https://github.com/datajoint/datajoint-python/pull/1142) diff --git a/tests/test_autopopulate.py b/tests/test_autopopulate.py index d1f0726e..fa3c6b72 100644 --- a/tests/test_autopopulate.py +++ b/tests/test_autopopulate.py @@ -49,6 +49,18 @@ def test_populate_with_success_count(subject, experiment, trial): assert len(trial.key_source & trial) == success_count +def test_populate_explicit_key_list(subject, experiment, trial): + # test simple populate + assert subject, "root tables are empty" + assert not experiment, "table already filled?" + keys = experiment.key_source.fetch("KEY", order_by="KEY") + n = 3 + keys = keys[:n] + assert len(keys) == n + ret = experiment.populate(keys) + assert n == ret["success_count"] + + def test_populate_exclude_error_and_ignore_jobs(schema_any, subject, experiment): # test simple populate assert subject, "root tables are empty"