@@ -107,3 +107,61 @@ def test_run_multipipe_with_datasets(batchmode: bool):
107107 ** {"batchmode" : batchmode }
108108 )
109109 assert response ["status" ] == "SUCCESS"
110+
111+
112+ @pytest .mark .parametrize ("batchmode" , [True , False ])
113+ def test_run_segment_reconstruct (batchmode : bool ):
114+ pipeline = PipelineFactory .list (query = "Segmentation/Reconstruction Functional Test - DO NOT DELETE" )["results" ][0 ]
115+ response = pipeline .run ("https://aixplain-platform-assets.s3.amazonaws.com/samples/en/CPAC1x2.wav" , ** {"batchmode" : batchmode })
116+
117+ assert response ["status" ] == "SUCCESS"
118+ output = response ["data" ][0 ]
119+ assert output ["label" ] == "Output 1"
120+
121+
122+ @pytest .mark .parametrize ("batchmode" , [True , False ])
123+ def test_run_metric (batchmode : bool ):
124+ pipeline = PipelineFactory .list (query = "ASR Metric Functional Test - DO NOT DELETE" )["results" ][0 ]
125+ response = pipeline .run ({
126+ "AudioInput" : "https://aixplain-platform-assets.s3.amazonaws.com/samples/en/CPAC1x2.wav" ,
127+ "ReferenceInput" : "https://aixplain-platform-assets.s3.amazonaws.com/samples/en/CPAC1x2.txt"
128+ }, ** {"batchmode" : batchmode })
129+
130+ assert response ["status" ] == "SUCCESS"
131+ assert len (response ["data" ]) == 2
132+ assert response ["data" ][0 ]["label" ] in ["TranscriptOutput" , "ScoreOutput" ]
133+ assert response ["data" ][1 ]["label" ] in ["TranscriptOutput" , "ScoreOutput" ]
134+
135+
136+ @pytest .mark .parametrize (
137+ "batchmode,input_data,output_data" ,
138+ [
139+ (True , "https://aixplain-platform-assets.s3.amazonaws.com/samples/en/CPAC1x2.wav" , "AudioOutput" ),
140+ (False , "https://aixplain-platform-assets.s3.amazonaws.com/samples/en/CPAC1x2.wav" , "AudioOutput" ),
141+ (True , "https://aixplain-platform-assets.s3.amazonaws.com/samples/en/CPAC1x2.txt" , "TextOutput" ),
142+ (False , "https://aixplain-platform-assets.s3.amazonaws.com/samples/en/CPAC1x2.txt" , "TextOutput" )
143+ ]
144+ )
145+ def test_run_router (batchmode : bool , input_data : str , output_data : str ):
146+ pipeline = PipelineFactory .list (query = "Router Test - DO NOT DELETE" )["results" ][0 ]
147+ response = pipeline .run (input_data , ** {"batchmode" : batchmode })
148+
149+ assert response ["status" ] == "SUCCESS"
150+ assert response ["data" ][0 ]["label" ] == output_data
151+
152+
153+ @pytest .mark .parametrize (
154+ "batchmode,input_data,output_data" ,
155+ [
156+ (True , "I love it." , "PositiveOutput" ),
157+ (False , "I love it." , "PositiveOutput" ),
158+ (True , "I hate it." , "NegativeOutput" ),
159+ (False , "I hate it." , "NegativeOutput" )
160+ ]
161+ )
162+ def test_run_decision (batchmode : bool , input_data : str , output_data : str ):
163+ pipeline = PipelineFactory .list (query = "Decision Test - DO NOT DELETE" )["results" ][0 ]
164+ response = pipeline .run (input_data , ** {"batchmode" : batchmode })
165+
166+ assert response ["status" ] == "SUCCESS"
167+ assert response ["data" ][0 ]["label" ] == output_data
0 commit comments