@@ -292,6 +292,56 @@ def test_log_input_artifact(under_test):
292292 assert "text/plain" == under_test .trial_component .input_artifacts ["foo.txt" ].media_type
293293
294294
295+ def test_log_inputs_error (under_test ):
296+ for index in range (0 , 30 ):
297+ file_path = "foo" + str (index ) + ".txt"
298+ under_test .trial_component .input_artifacts [file_path ] = {
299+ "foo" : api_types .TrialComponentArtifact (value = "baz" + str (index ), media_type = "text/text" )
300+ }
301+ with pytest .raises (ValueError ):
302+ under_test .log_input ("foo.txt" , "name" , "whizz/bang" )
303+
304+
305+ def test_log_outputs (under_test ):
306+ for index in range (0 , 30 ):
307+ file_path = "foo" + str (index ) + ".txt"
308+ under_test .trial_component .output_artifacts [file_path ] = {
309+ "foo" : api_types .TrialComponentArtifact (value = "baz" + str (index ), media_type = "text/text" )
310+ }
311+ with pytest .raises (ValueError ):
312+ under_test .log_output ("foo.txt" , "name" , "whizz/bang" )
313+
314+
315+ def test_log_multiple_input_artifact (under_test ):
316+ for index in range (0 , 30 ):
317+ file_path = "foo" + str (index ) + ".txt"
318+ under_test ._artifact_uploader .upload_artifact .return_value = (
319+ "s3uri_value" + str (index ),
320+ "etag_value" + str (index ),
321+ )
322+ under_test .log_input_artifact (file_path , "name" + str (index ), "whizz/bang" + str (index ))
323+ under_test ._artifact_uploader .upload_artifact .assert_called_with (file_path )
324+
325+ under_test ._artifact_uploader .upload_artifact .return_value = ("s3uri_value" , "etag_value" )
326+ with pytest .raises (ValueError ):
327+ under_test .log_input_artifact ("foo.txt" , "name" , "whizz/bang" )
328+
329+
330+ def test_log_multiple_output_artifact (under_test ):
331+ for index in range (0 , 30 ):
332+ file_path = "foo" + str (index ) + ".txt"
333+ under_test ._artifact_uploader .upload_artifact .return_value = (
334+ "s3uri_value" + str (index ),
335+ "etag_value" + str (index ),
336+ )
337+ under_test .log_output_artifact (file_path , "name" + str (index ), "whizz/bang" + str (index ))
338+ under_test ._artifact_uploader .upload_artifact .assert_called_with (file_path )
339+
340+ under_test ._artifact_uploader .upload_artifact .return_value = ("s3uri_value" , "etag_value" )
341+ with pytest .raises (ValueError ):
342+ under_test .log_output_artifact ("foo.txt" , "name" , "whizz/bang" )
343+
344+
295345def test_log_pr_curve (under_test ):
296346
297347 y_true = [0 , 0 , 1 , 1 ]
0 commit comments