Skip to content

Commit

Permalink
added test to increase code cov
Browse files Browse the repository at this point in the history
  • Loading branch information
astronomyk committed Jan 31, 2024
1 parent 7fc21e9 commit d266d00
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions scopesim/tests/test_utils_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,15 @@ def test_converts_astropy_table(self):
names=["seeds", "seeds2"])
assert utils.from_currsys(tbl["seeds2"][1]) is None

def test_converts_string_numericals_to_floats(self):
old = rc.__currsys__["!SIM.sub_pixel.fraction"]
rc.__currsys__["!SIM.sub_pixel.fraction"] = "1e0"

result = utils.from_currsys("!SIM.sub_pixel.fraction")
assert isinstance(result, float)
assert result == 1

rc.__currsys__["!SIM.sub_pixel.flag"] = old


# load_example_optical_train modifies __currsys__!
Expand Down

0 comments on commit d266d00

Please sign in to comment.