Skip to content

Commit

Permalink
test raise error in emsc
Browse files Browse the repository at this point in the history
  • Loading branch information
paucablop committed Sep 21, 2023
1 parent 5a5665d commit c1a26ad
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/test_functionality.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,19 @@ def test_extended_baseline_correction_with_weights():
assert np.allclose(spectrum_emsc[0], reference, atol=1e-8)


def test_extended_baseline_correction_with_no_reference():
# Arrange
spectrum = np.array([1.0, 2.0, 3.0, 4.0, 5.0]).reshape(1, -1)

# Act
emsc = ExtendedMultiplicativeScatterCorrection(use_mean=False, use_median=False)

# Assert
with pytest.raises(ValueError):
emsc.fit_transform(spectrum)



def test_extended_baseline_correction_with_wrong_reference():
# Arrange
spectrum = np.array([1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0]).reshape(
Expand Down

0 comments on commit c1a26ad

Please sign in to comment.