Skip to content

Commit d5eb7fb

Browse files
committed
test fold_path_dict
1 parent 43f8125 commit d5eb7fb

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

test/test_folding.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,4 +93,11 @@ def test_unfold_path_dict_invalid(self):
9393

9494

9595
def test_fold_path_dict(self):
96-
raise Exception('TODO: test fold_path_dict')
96+
test = {'a': {'b': list('cde'), 'f': 'g'}}
97+
expected_sort_items = (
98+
('a.b[0]', 'c'),
99+
('a.b[1]', 'd'),
100+
('a.b[2]', 'e'),
101+
('a.f', 'g'),
102+
)
103+
self.assertEqual(tuple(sorted(datapath.folding.fold_path_dict(test).items())), expected_sort_items)

0 commit comments

Comments
 (0)