Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dubusster committed Dec 15, 2023
1 parent 74a52ca commit 291a177
Showing 1 changed file with 26 additions and 10 deletions.
36 changes: 26 additions & 10 deletions tests/python/test_rir.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,20 @@ def test_zstd_compress(data_bytes):


def test_zstd_decompress(c, data_bytes):
assert rts.zstd_decompress(c) == data_bytes
rts.zstd_decompress(c) == data_bytes


def test_blosc_compress_zstd(data_bytes):
c = rts.blosc_compress_zstd(data_bytes, 2, rts.BLOSC_SHUFFLE, 1)
print(len(c))
rts.blosc_compress_zstd(data_bytes, 2, rts.BLOSC_SHUFFLE, 1)


@pytest.fixture
def compressed_blosc(data_bytes):
return rts.blosc_compress_zstd(data_bytes, 2, rts.BLOSC_SHUFFLE, 1)

def test_blosc_decompress_zstd(c):
print(rts.blosc_decompress_zstd(c))

def test_blosc_decompress_zstd(compressed_blosc):
print(rts.blosc_decompress_zstd(compressed_blosc))


def test_file_attributes():
Expand Down Expand Up @@ -98,6 +102,9 @@ def test_translate():
img = np.ones((12, 12), dtype=np.float64)
img = sp.translate(img, 1.2, 1.3, "constant", 0)
print(img)
with pytest.raises(RuntimeError):
_img = np.ones((12, 12, 12), dtype=np.float64)
_img = sp.translate(_img, 1.2, 1.3, "constant", 0)


def test_gaussian_filter():
Expand Down Expand Up @@ -129,16 +136,25 @@ def test_resample_time_serie():
print(sp.resample_time_serie(x, y, times, None, False))


def test_jpegls_encode():
global c
@pytest.fixture
def _img():
img = np.ones((20, 12), dtype=np.uint16)
return img


@pytest.fixture
def jpegls_encoded(img):
return sp.jpegls_encode(img)


def test_jpegls_encode(img):
c = sp.jpegls_encode(img)
print(len(c))


def test_jpegls_decode():
global c
img = sp.jpegls_decode(c, 12, 20)
def test_jpegls_decode(img, jpegls_encoded):
_img = sp.jpegls_decode(c, 12, 20)
assert all(_img == img)
print(img)


Expand Down

0 comments on commit 291a177

Please sign in to comment.