@@ -141,7 +141,7 @@ def test_default_output_fn_json(tensor):
141
141
output = default_output_fn (tensor , content_types .JSON )
142
142
143
143
assert json .dumps (tensor .cpu ().numpy ().tolist ()) in output .get_data (as_text = True )
144
- assert content_types .JSON in output .content_type
144
+ assert content_types .JSON == output .mimetype
145
145
146
146
147
147
def test_default_output_fn_npy (tensor ):
@@ -151,23 +151,23 @@ def test_default_output_fn_npy(tensor):
151
151
np .save (stream , tensor .cpu ().numpy ())
152
152
153
153
assert stream .getvalue () in output .get_data (as_text = False )
154
- assert content_types .NPY in output .content_type
154
+ assert content_types .NPY == output .mimetype
155
155
156
156
157
157
def test_default_output_fn_csv_long ():
158
158
tensor = torch .LongTensor ([[1 , 2 , 3 ], [4 , 5 , 6 ]])
159
159
output = default_output_fn (tensor , content_types .CSV )
160
160
161
161
assert '1,2,3\n 4,5,6\n ' in output .get_data (as_text = True )
162
- assert content_types .CSV in output .content_type
162
+ assert content_types .CSV == output .mimetype
163
163
164
164
165
165
def test_default_output_fn_csv_float ():
166
166
tensor = torch .FloatTensor ([[1 , 2 , 3 ], [4 , 5 , 6 ]])
167
167
output = default_output_fn (tensor , content_types .CSV )
168
168
169
169
assert '1.0,2.0,3.0\n 4.0,5.0,6.0\n ' in output .get_data (as_text = True )
170
- assert content_types .CSV in output .content_type
170
+ assert content_types .CSV == output .mimetype
171
171
172
172
173
173
def test_default_output_fn_bad_accept ():
@@ -182,7 +182,7 @@ def test_default_output_fn_gpu():
182
182
output = default_output_fn (tensor_gpu , content_types .CSV )
183
183
184
184
assert '1,2,3\n 4,5,6\n ' in output .get_data (as_text = True )
185
- assert content_types .CSV in output .content_type
185
+ assert content_types .CSV == output .mimetype
186
186
187
187
188
188
@patch ('sagemaker_containers.beta.framework.modules.import_module' )
0 commit comments