Пример #1
0
 def test_numpy_ndarray_instance(self):
     array = np.arange(10)
     result = ensure_array(array)
     self.assertIsInstance(result, NumpyArrayAdapter)
     assert_array_equal(array, result.ndarray())
Пример #2
0
 def test_other_type(self):
     with self.assertRaises(TypeError):
         ensure_array(range(10))
Пример #3
0
 def test_array_instance(self):
     array = mock.Mock(spec=Array)
     result = ensure_array(array)
     self.assertIs(array, result)