Skip to content

Commit

Permalink
modify type tests to include IntParticles
Browse files Browse the repository at this point in the history
  • Loading branch information
joeljonsson committed Nov 6, 2023
1 parent f104123 commit 12a7c84
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pyapr/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
def test_utils():
assert isinstance(pyapr.utils.type_to_particles(np.uint8), pyapr.ByteParticles)
assert isinstance(pyapr.utils.type_to_particles(np.uint16), pyapr.ShortParticles)
assert isinstance(pyapr.utils.type_to_particles(np.int32), pyapr.IntParticles)
assert isinstance(pyapr.utils.type_to_particles(np.uint64), pyapr.LongParticles)
assert isinstance(pyapr.utils.type_to_particles(np.float32), pyapr.FloatParticles)

Expand All @@ -17,6 +18,7 @@ def test_utils():

assert pyapr.utils.particles_to_type(pyapr.ByteParticles()) is np.uint8
assert pyapr.utils.particles_to_type(pyapr.ShortParticles()) is np.uint16
assert pyapr.utils.particles_to_type(pyapr.IntParticles()) is np.int32
assert pyapr.utils.particles_to_type(pyapr.LongParticles()) is np.uint64
assert pyapr.utils.particles_to_type(pyapr.FloatParticles()) is np.float32

Expand All @@ -29,7 +31,7 @@ def test_utils():
pyapr.utils.particles_to_type(np.zeros(5, dtype=np.uint16))

with pytest.raises(ValueError):
pyapr.utils.type_to_particles(np.int32)
pyapr.utils.type_to_particles(np.int64)

with pytest.raises(ValueError):
pyapr.utils.type_to_lazy_particles(np.float64)
Expand Down

0 comments on commit 12a7c84

Please sign in to comment.