Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests suite #120

Merged
merged 18 commits into from
Apr 22, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test: Update tests to better reflect real conditions
  • Loading branch information
lahdjirayhan committed Apr 22, 2022
commit 6c88e355dcc3e2374229a7381edea99d2bfed664
8 changes: 4 additions & 4 deletions tests/test_get_coordinate_air.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def test_column_expected_contents():

# London's coordinates
assert result.at[0, "latitude"] == pytest.approx(51.507351)
assert result.at[0, "longitude"] == pytest.approx(-0.127759)
assert result.at[0, "longitude"] == pytest.approx(-0.1277583)


@pytest.mark.vcr
Expand Down Expand Up @@ -85,9 +85,6 @@ def test_bad_coordinates():
with pytest.raises(Exception, match="Invalid geo position"):
api.get_coordinate_air(None, None)

with pytest.raises(Exception, match="Invalid geo position"):
api.get_coordinate_air(numpy.nan, numpy.nan)

# Giving coordinates as string of numerics is fine,
# even though it's not in accordance with Ozone's method definition.
api.get_coordinate_air("51.51", "-0.13")
Expand All @@ -96,6 +93,9 @@ def test_bad_coordinates():
api.get_coordinate_air(5000, 5000)
api.get_coordinate_air(-5000, -5000)

# Giving nan coordinates is also fine
api.get_coordinate_air(numpy.nan, numpy.nan)


@pytest.mark.vcr
def test_bad_data_format():
Expand Down