Skip to content

Commit

Permalink
Extra unit test.
Browse files Browse the repository at this point in the history
  • Loading branch information
astronomerritt committed May 9, 2024
1 parent ad9a4f7 commit 0a2fb2c
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/adler/dataclasses/test_AdlerPlanetoid.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,3 +148,23 @@ def test_for_warnings(capsys):
)

assert captured.out == expected


def test_failed_SQL_queries():
test_planetoid = AdlerPlanetoid.construct_from_SQL(
ssoid, test_db_path, filter_list=["u", "g", "r", "i", "z", "y"]
)

with pytest.raises(Exception) as error_info_1:
test_planetoid.populate_MPCORB("826857066833589477", sql_filename=test_db_path, schema="")

assert error_info_1.value.args[0] == "No MPCORB data for this object could be found for this SSObjectId."

with pytest.raises(Exception) as error_info_2:
test_planetoid.populate_SSObject(
"826857066833589477", filter_list=["u"], sql_filename=test_db_path, schema=""
)

assert (
error_info_2.value.args[0] == "No SSObject data for this object could be found for this SSObjectId."
)

0 comments on commit 0a2fb2c

Please sign in to comment.