Skip to content

Commit

Permalink
try to improve code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
KedoKudo committed Feb 19, 2024
1 parent f726d3d commit 11d672b
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/unit/backend/corrections/test_beam_hardening.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,22 @@ def fake_beam_hardening_image() -> np.ndarray:

def test_beam_hardening_correction(fake_beam_hardening_image):
"""Test beam hardening correction"""
# test with incorrect array dim
with pytest.raises(ValueError):
beam_hardening_correction(
arrays=np.array([0, 1, 2, 3]),
q=0.005,
n=20.0,
opt=True,
)
# test with single image
corrected_image = beam_hardening_correction(
arrays=fake_beam_hardening_image[0],
q=0.005,
n=20.0,
opt=True,
)
assert corrected_image.shape == (255, 255)
# test the correction
corrected_image = beam_hardening_correction(
arrays=fake_beam_hardening_image,
Expand Down

1 comment on commit 11d672b

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GitLab pipeline for imars3d has been submitted for this commit: "https://code.ornl.gov/sns-hfir-scse/deployments/imars-deploy/-/pipelines/526880"

Please sign in to comment.