Skip to content

Commit

Permalink
add unit tests of NumpyTupleDatasetFeatureIndexer
Browse files Browse the repository at this point in the history
  • Loading branch information
mottodora committed Jun 26, 2018
1 parent 94cf8f3 commit 7a70195
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/dataset_tests/test_numpy_tuple_feature_indexer.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ def test_extract_feature_by_slice(self, indexer, data, slice_index, j):
indexer.extract_feature_by_slice(slice_index, j),
data[j][slice_index])

@pytest.mark.parametrize('ndarray_index', [numpy.asarray([0, 1]),
numpy.asarray([1])])
@pytest.mark.parametrize('j', [0, 1])
def test_extract_feature_by_ndarray(self, indexer, data, ndarray_index, j):
numpy.testing.assert_array_equal(
indexer.extract_feature_by_slice(ndarray_index, j),
data[j][ndarray_index])


if __name__ == '__main__':
pytest.main([__file__, '-v'])

0 comments on commit 7a70195

Please sign in to comment.