Skip to content

Commit

Permalink
Add type check for return results of get_items
Browse files Browse the repository at this point in the history
  • Loading branch information
dyashuni committed Aug 13, 2023
1 parent f22a5b1 commit db19931
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tests/python/bindings_test_getdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,11 @@ def testGettingItems(self):
self.assertRaises(ValueError, lambda: p.get_items(labels[0]))

# After adding them, all labels should be retrievable
returned_items = p.get_items(labels)
self.assertTrue((data == returned_items).all())
returned_items_np = p.get_items(labels)
self.assertTrue((data == returned_items_np).all())

# check returned type of get_items
self.assertTrue(isinstance(returned_items_np, np.ndarray))
returned_items_list = p.get_items(labels, return_type="list")
self.assertTrue(isinstance(returned_items_list, list))
self.assertTrue(isinstance(returned_items_list[0], list))

0 comments on commit db19931

Please sign in to comment.