Skip to content

Commit

Permalink
Fixing some issues in unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-rodriguez committed Jul 2, 2024
1 parent 6221c85 commit 9bf6ae1
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions tests/test_spectra_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ def test_ingest_spectrum_errors(temp_db):
with pytest.raises(AstroDBError) as error_message:
ingest_spectrum(temp_db, source="apple", spectrum=spectrum)
# assert "Regime is required" in str(error_message.value)
# Commented out the error_message assertions since we have more generic error messages with this

result = ingest_spectrum(
temp_db, source="apple", spectrum=spectrum, raise_error=False
)
Expand All @@ -51,7 +53,8 @@ def test_ingest_spectrum_errors(temp_db):
spectrum=spectrum,
)
# assert "Reference is required" in str(error_message.value)
ingest_spectrum(

result = ingest_spectrum(
temp_db, source="apple", regime="nir", spectrum=spectrum, raise_error=False
)
assert result["added"] is False
Expand All @@ -69,7 +72,8 @@ def test_ingest_spectrum_errors(temp_db):
reference="Ref 5",
)
# assert "not in Publications table" in str(error_message.value)
ingest_spectrum(

result = ingest_spectrum(
temp_db,
source="apple",
regime="nir",
Expand All @@ -95,6 +99,7 @@ def test_ingest_spectrum_errors(temp_db):
mode="Prism",
)
# assert "No unique source match for kiwi in the database" in str(error_message.value)

result = ingest_spectrum(
temp_db,
source="kiwi",
Expand All @@ -121,6 +126,7 @@ def test_ingest_spectrum_errors(temp_db):
mode="Prism",
)
# assert "missing observation date" in str(error_message.value)

result = ingest_spectrum(
temp_db,
source="apple",
Expand Down Expand Up @@ -149,6 +155,7 @@ def test_ingest_spectrum_errors(temp_db):
mode="OG570",
)
# assert "not in Regimes table" in str(error_message.value)

result = ingest_spectrum(
temp_db,
source="orange",
Expand Down

0 comments on commit 9bf6ae1

Please sign in to comment.