Skip to content

Commit

Permalink
fix unit tests which were ignoring some cases, due to the change of -…
Browse files Browse the repository at this point in the history
…-bad-star to --bad-star-id
  • Loading branch information
javierggt committed Jan 29, 2021
1 parent 7823112 commit 906d542
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions agasc/tests/test_obs_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,22 +196,22 @@ def test_parse_obs_status_args_bad(monkeypatch):
#######################

status = update_obs_status._parse_obs_status_args(
bad_star=1, bad_star_source=2
bad_star_id=1, bad_star_source=2
)
assert status['obs'] == {}
assert status['bad'] == {1: 2}

# bad star can be a list
status = update_obs_status._parse_obs_status_args(
bad_star=[1, 2], bad_star_source=3
bad_star_id=[1, 2], bad_star_source=3
)
assert status['obs'] == {}
assert status['bad'] == {1: 3, 2: 3}

# if you specify bad_star, you must specify bad_star_source
with pytest.raises(RuntimeError, match=r"specify bad_star_source"):
update_obs_status._parse_obs_status_args(
bad_star=1
bad_star_id=1
)


Expand Down Expand Up @@ -297,14 +297,14 @@ def test_parse_obs_status_args(monkeypatch):
with pytest.raises(RuntimeError, match=r"name collision"):
_ = update_obs_status._parse_obs_status_args(
filename=filename,
bad_star=23434,
bad_star_id=23434,
bad_star_source=12
)

# can specify bad star in the file and in args if the source is the same.
status = update_obs_status._parse_obs_status_args(
filename=filename,
bad_star=23434,
bad_star_id=23434,
bad_star_source=10
)
ref = copy.deepcopy(TEST_DATA[filename])
Expand All @@ -316,7 +316,7 @@ def test_parse_obs_status_args(monkeypatch):
obs=56309,
agasc_id=[762184312, 762184768, 762185584, 762186016],
status=False,
bad_star=[1, 2],
bad_star_id=[1, 2],
bad_star_source=1000
)
ref = update_obs_status._parse_obs_status_args(
Expand All @@ -326,7 +326,7 @@ def test_parse_obs_status_args(monkeypatch):
obs=56309,
agasc_id=[762184312, 762184768, 762185584, 762186016],
status=False,
bad_star=[1, 2],
bad_star_id=[1, 2],
bad_star_source=1000
)
ref['obs'].update(ref_2['obs'])
Expand Down

0 comments on commit 906d542

Please sign in to comment.