Skip to content

Commit

Permalink
change path for test data in test_rmf
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlo Ferrigno committed Oct 16, 2024
1 parent fdc4c68 commit 04bd4dd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/test_data_products.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@


def test_rmf():
isgri_rmf_dp = NumpyDataProduct.from_fits_file("test_data/isgri_rmf_Crab.fits")
isgri_rmf_dp = NumpyDataProduct.from_fits_file("tests/test_data/isgri_rmf_Crab.fits")

Check warning on line 41 in tests/test_data_products.py

View check run for this annotation

Codecov / codecov/patch

tests/test_data_products.py#L41

Added line #L41 was not covered by tests

encoded_numpy_data_prod = isgri_rmf_dp.encode()
decoded_numpy_data_prod = NumpyDataProduct.decode(encoded_numpy_data_prod)

Check warning on line 44 in tests/test_data_products.py

View check run for this annotation

Codecov / codecov/patch

tests/test_data_products.py#L43-L44

Added lines #L43 - L44 were not covered by tests
Expand All @@ -50,12 +50,14 @@ def test_rmf():
try:
_hdul.append(_d.to_fits_hdu())
except Exception as ee:

Check warning on line 52 in tests/test_data_products.py

View check run for this annotation

Codecov / codecov/patch

tests/test_data_products.py#L47-L52

Added lines #L47 - L52 were not covered by tests
# print(ee)
raise Exception(ee)

Check warning on line 54 in tests/test_data_products.py

View check run for this annotation

Codecov / codecov/patch

tests/test_data_products.py#L54

Added line #L54 was not covered by tests

# this reproduces the commands done in the nb2workflow plugin
# this reproduces the commands done inside the above call (?)
binarys = base64.b64decode(encoded_numpy_data_prod['data_unit_list'][2]['binarys'])
try:
pickle.loads(binarys, encoding='bytes')
print('pickle test successful')
except Exception as ee:
raise Exception(ee)

Check warning on line 62 in tests/test_data_products.py

View check run for this annotation

Codecov / codecov/patch

tests/test_data_products.py#L57-L62

Added lines #L57 - L62 were not covered by tests

Expand Down

0 comments on commit 04bd4dd

Please sign in to comment.