-
Notifications
You must be signed in to change notification settings - Fork 5
Added mock-based test, made by Copilot #181
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
Conversation
We have the previous fixtures here: https://github.com/OpenDrift/trajan/blob/main/tests/fixtures.py so that they are available to all tests. |
tests/test_traj.py
Outdated
# assert "obs" in result.dims | ||
|
||
|
||
def test_distance_to_next(mock_traj): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is tested in test_interpolate
tests/test_traj.py
Outdated
assert "cell_area" in result.data_vars | ||
|
||
|
||
def test_crop(mock_traj): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tested in geo selection... where the test actually tests something :D
tests/test_traj.py
Outdated
|
||
def test_contained_in(mock_traj): | ||
result = mock_traj.contained_in(lonmin=0, lonmax=5, latmin=0, latmax=5) | ||
assert isinstance(result, xr.Dataset) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
tests/test_traj.py
Outdated
result = mock_traj.azimuth_to_next() | ||
assert isinstance(result, xr.DataArray) | ||
assert result.name is None | ||
assert "obs" in result.dims |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should test the values?
tests/test_traj.py
Outdated
result = mock_traj.index_of_last() | ||
assert isinstance(result, xr.DataArray) | ||
assert result.name == "index_of_last" | ||
assert "trajectory" in result.dims |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
value?
No description provided.