Example #1
0
 def test_list_of_dtype_names(self, mock_nd):
     mock_nd.return_value = "foo"
     dtypes = iadt.normalize_dtypes(["int16", "int32"])
     assert dtypes == ["foo", "foo"]
     assert mock_nd.call_count == 2
     assert mock_nd.call_args_list[0][0][0] == "int16"
     assert mock_nd.call_args_list[1][0][0] == "int32"
Example #2
0
 def test_single_dtype(self):
     dtypes = iadt.normalize_dtypes(np.dtype("int16"))
     assert isinstance(dtypes, list)
     assert len(dtypes) == 1
     assert isinstance(dtypes[0], np.dtype)
     assert dtypes[0].name == "int16"
Example #3
0
 def test_empty_list(self):
     dtypes = iadt.normalize_dtypes([])
     assert isinstance(dtypes, list)
     assert len(dtypes) == 0
Example #4
0
 def test_single_non_list(self, mock_nd):
     mock_nd.return_value = "foo"
     dtypes = iadt.normalize_dtypes("int16")
     assert dtypes == ["foo"]
     assert mock_nd.call_count == 1
     assert mock_nd.call_args_list[0][0][0] == "int16"