1010import iris_grib .tests as tests
1111
1212import gribapi
13- import numpy as np
1413from unittest import mock
1514
1615import iris_grib
@@ -24,22 +23,14 @@ def setUp(self):
2423 def test_save (self ):
2524 m = mock .mock_open ()
2625 with mock .patch ('builtins.open' , m , create = True ):
27- # sending a MagicMock object to gribapi raises an AssertionError
28- # as the gribapi code does a type check
29- # this is deemed acceptable within the scope of this unit test
30- with self .assertRaises ((AssertionError , TypeError )):
31- iris_grib .save_messages ([self .grib_message ], 'foo.grib2' )
26+ iris_grib .save_messages ([self .grib_message ], 'foo.grib2' )
3227 self .assertTrue (mock .call ('foo.grib2' , 'wb' ) in m .mock_calls )
3328
3429 def test_save_append (self ):
3530 m = mock .mock_open ()
3631 with mock .patch ('builtins.open' , m , create = True ):
37- # sending a MagicMock object to gribapi raises an AssertionError
38- # as the gribapi code does a type check
39- # this is deemed acceptable within the scope of this unit test
40- with self .assertRaises ((AssertionError , TypeError )):
41- iris_grib .save_messages ([self .grib_message ], 'foo.grib2' ,
42- append = True )
32+ iris_grib .save_messages ([self .grib_message ], 'foo.grib2' ,
33+ append = True )
4334 self .assertTrue (mock .call ('foo.grib2' , 'ab' ) in m .mock_calls )
4435
4536
0 commit comments