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

remove redundant tests #3650

Merged
merged 1 commit into from
Feb 11, 2020
Merged
Changes from all commits
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
39 changes: 0 additions & 39 deletions lib/iris/tests/unit/analysis/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,42 +4,3 @@
# See COPYING and COPYING.LESSER in the root of the repository for full
# licensing details.
"""Unit tests for the :mod:`iris.analysis` package."""

# Import iris.tests first so that some things can be initialised before
# importing anything else.
import iris.tests as tests

from unittest import mock

from iris.analysis import Linear


class Test_Linear(tests.IrisTest):
def setUp(self):
self.extrap = "some extrapolation"

def test___init__(self):
linear = Linear(extrapolation_mode=self.extrap)
self.assertEqual(
getattr(linear, "extrapolation_mode", None), self.extrap
)

@mock.patch("iris.analysis.LinearInterpolator", name="LinearInterpolator")
def test_interpolator(self, linear_interp_patch):
mock_interpolator = mock.Mock(name="mocked linear interpolator")
linear_interp_patch.return_value = mock_interpolator

linear = Linear(self.extrap)
cube = mock.Mock(name="cube")
coords = mock.Mock(name="coords")

interpolator = linear.interpolator(cube, coords)

self.assertIs(interpolator, mock_interpolator)
linear_interp_patch.assert_called_once_with(
cube, coords, extrapolation_mode=self.extrap
)


if __name__ == "__main__":
tests.main()