Skip to content

Commit

Permalink
test raising errors on wrong bounds length
Browse files Browse the repository at this point in the history
  • Loading branch information
missing-user committed Dec 18, 2024
1 parent aa0c58f commit 17821ee
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/core/test_optimizable.py
Original file line number Diff line number Diff line change
Expand Up @@ -858,6 +858,10 @@ def test_full_lower_bounds(self):
self.assertTrue(np.allclose(iden.lower_bounds, np.array([4])))
self.assertTrue(np.allclose(iden.lower_bounds, iden.full_lower_bounds))
self.assertTrue(np.allclose(opt.full_bounds[0], opt.full_lower_bounds))
with self.assertRaises(ValueError): # Too few elements
opt.full_lower_bounds = np.array([1, 2, 3])
with self.assertRaises(ValueError): # Too many elements
opt.full_lower_bounds = np.array([1, 2, 3, 4, 5])

def test_local_lower_bounds(self):
pass
Expand All @@ -878,6 +882,10 @@ def test_full_upper_bounds(self):
self.assertTrue(np.allclose(iden.upper_bounds, np.array([4])))
self.assertTrue(np.allclose(iden.upper_bounds, iden.full_upper_bounds))
self.assertTrue(np.allclose(opt.full_bounds[1], opt.full_upper_bounds))
with self.assertRaises(ValueError): # Too few elements
opt.full_upper_bounds = np.array([1, 2, 3])
with self.assertRaises(ValueError): # Too many elements
opt.full_upper_bounds = np.array([1, 2, 3, 4, 5])

def test_local_upper_bounds(self):
pass
Expand Down

0 comments on commit 17821ee

Please sign in to comment.