Skip to content

Commit 196cd4f

Browse files
committed
Test reading from field selection with MultiManager
1 parent c284df3 commit 196cd4f

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

test/hl/test_dataset.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2432,9 +2432,9 @@ def test_multi_selection(self):
24322432
for i in range(count):
24332433
np.testing.assert_array_equal(data_out[i][6:, 6:, 6:], data_in_original[i][6:, 6:, 6:])
24342434

2435-
def test_multi_write_field_selection(self):
2435+
def test_multi_field_selection(self):
24362436
"""
2437-
Test writing to a field selection on multiple datasets
2437+
Test reading/writing to a field selection on multiple datasets
24382438
"""
24392439
dt = np.dtype([('a', np.float32), ('b', np.int32), ('c', np.float32)])
24402440
shape = (100,)
@@ -2448,6 +2448,14 @@ def test_multi_write_field_selection(self):
24482448
dtype=dt)
24492449
datasets.append(dset)
24502450

2451+
# Perform read from field 'b'
2452+
mm = MultiManager(datasets=datasets)
2453+
out = mm[..., 'b']
2454+
2455+
# Verify data returned
2456+
for i in range(count):
2457+
np.testing.assert_array_equal(out[i], np.zeros(shape, dtype=dt['b']))
2458+
24512459
# Perform write to field 'b'
24522460
mm = MultiManager(datasets=datasets)
24532461
mm[..., 'b'] = [data['b'], data['b'], data['b']]

0 commit comments

Comments
 (0)