Skip to content

Commit

Permalink
A couple of small test additions.
Browse files Browse the repository at this point in the history
  • Loading branch information
bluescarni committed Jun 13, 2024
1 parent 768ebbd commit a56eafe
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions heyoka/_test_var_integrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ def test_scalar(self):
self.assertEqual(ts.shape, (2,))
self.assertTrue(np.all(ts == [0.0, 0.0]))

# Test that tstate cannot be written to.
with self.assertRaises(ValueError) as cm:
ta.tstate[0] = 0.5

self.assertEqual(ta.get_vslice(order=0), slice(0, 2, None))
self.assertEqual(ta.get_vslice(order=0, component=1), slice(1, 2, None))

Expand Down Expand Up @@ -168,6 +172,10 @@ def test_batch(self):
self.assertEqual(ts.shape, (2, 2))
self.assertTrue(np.all(ts == [[0.0, 0.0], [0.0, 0.0]]))

# Test that tstate cannot be written to.
with self.assertRaises(ValueError) as cm:
ta.tstate[0] = 0.5

self.assertEqual(ta.get_vslice(order=0), slice(0, 2, None))
self.assertEqual(ta.get_vslice(order=0, component=1), slice(1, 2, None))

Expand Down

0 comments on commit a56eafe

Please sign in to comment.