aboutsummaryrefslogtreecommitdiff
path: root/tests/unit/test_data_helpers.py
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2021-11-18 11:59:53 +0300
committerFrederick Muriuki Muriithi2021-11-18 11:59:53 +0300
commit3dd5fbda7e08999b6470cfe1fbbd19d767adea9b (patch)
treefed4d0ae18d8d39a35184c7e9d80bd942c9f37a3 /tests/unit/test_data_helpers.py
parent21fbbfd599c841f082d88ddfc5f4cb362e1eb869 (diff)
downloadgenenetwork3-3dd5fbda7e08999b6470cfe1fbbd19d767adea9b.tar.gz
Fix some linting errors
Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/partial-correlations.gmi * Fix some obvious linting errors and remove obsolete code
Diffstat (limited to 'tests/unit/test_data_helpers.py')
-rw-r--r--tests/unit/test_data_helpers.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/unit/test_data_helpers.py b/tests/unit/test_data_helpers.py
index 3f76344..88ea469 100644
--- a/tests/unit/test_data_helpers.py
+++ b/tests/unit/test_data_helpers.py
@@ -61,6 +61,21 @@ class TestDataHelpers(TestCase):
expected)
def test_partition_by(self):
+ """
+ Test that `partition_by` groups the data using the given predicate
+
+ Given:
+ - `part_fn`: a predicate funtion that return boolean True/False
+ - `items`: a sequence of items
+ When:
+ - the partitioning predicate function and the sequence of items are
+ passed to the `partition_by` function
+ Then:
+ - the result is a tuple, with sub-tuples containing the data in the
+ original sequence. Each sub-tuple is a partition, ending as soon as
+ the next value in the sequence, when passed to `part_fn`, returns
+ boolean `True`.
+ """
for part_fn, items, expected in (
(lambda s: s.startswith("----"),
("------", "a", "b", "-----", "c", "----", "d", "e", "---",