Skip to content

Commit

Permalink
remove redundant tests (#3650)
Browse files Browse the repository at this point in the history
  • Loading branch information
bjlittle authored Feb 11, 2020
1 parent 4410e56 commit 836244e
Showing 1 changed file with 0 additions and 39 deletions.
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()

0 comments on commit 836244e

Please sign in to comment.