@@ -118,7 +118,7 @@ def session_fixture():
118118 updated_at = DATETIME_TESTING ,
119119 sst_generated = False ,
120120 valid = True ,
121- schemas = [SchemaType .PDP_COURSE ],
121+ schemas = [SchemaType .COURSE ],
122122 )
123123 file_3 = FileTable (
124124 id = FILE_UUID_3 ,
@@ -129,7 +129,7 @@ def session_fixture():
129129 updated_at = DATETIME_TESTING ,
130130 sst_generated = True ,
131131 valid = True ,
132- schemas = [SchemaType .PDP_COHORT ],
132+ schemas = [SchemaType .STUDENT ],
133133 )
134134 model_1 = ModelTable (
135135 id = SAMPLE_UUID ,
@@ -139,20 +139,15 @@ def session_fixture():
139139 [
140140 [
141141 SchemaConfigObj (
142- schema_type = SchemaType .PDP_COURSE ,
142+ schema_type = SchemaType .COURSE ,
143143 optional = False ,
144144 multiple_allowed = False ,
145145 ),
146146 SchemaConfigObj (
147- schema_type = SchemaType .PDP_COHORT ,
147+ schema_type = SchemaType .STUDENT ,
148148 optional = False ,
149149 multiple_allowed = False ,
150150 ),
151- SchemaConfigObj (
152- schema_type = SchemaType .SST_PDP_FINANCE ,
153- optional = True ,
154- multiple_allowed = False ,
155- ),
156151 ]
157152 ]
158153 ),
@@ -189,7 +184,7 @@ def session_fixture():
189184 updated_at = DATETIME_TESTING ,
190185 sst_generated = False ,
191186 valid = False ,
192- schemas = [SchemaType .PDP_COURSE ],
187+ schemas = [SchemaType .COURSE ],
193188 ),
194189 file_3 ,
195190 model_1 ,
@@ -329,23 +324,18 @@ def test_read_inst_model_output(client: TestClient):
329324def test_create_model (client : TestClient ):
330325 """Depending on timeline, fellows may not get to this."""
331326 schema_config_1 = {
332- "schema_type" : SchemaType .PDP_COURSE ,
327+ "schema_type" : SchemaType .COURSE ,
333328 "count" : 1 ,
334329 }
335330 schema_config_2 = {
336- "schema_type" : SchemaType .PDP_COHORT ,
331+ "schema_type" : SchemaType .STUDENT ,
337332 "count" : 1 ,
338333 }
339- schema_config_3 = {
340- "schema_type" : SchemaType .SST_PDP_FINANCE ,
341- "count" : 1 ,
342- "optional" : True ,
343- }
344334 response = client .post (
345335 "/institutions/" + uuid_to_str (USER_VALID_INST_UUID ) + "/models/" ,
346336 json = {
347337 "name" : "my_model" ,
348- "schema_configs" : [[schema_config_1 , schema_config_2 , schema_config_3 ]],
338+ "schema_configs" : [[schema_config_1 , schema_config_2 ]],
349339 },
350340 )
351341
@@ -368,9 +358,8 @@ def test_trigger_inference_run(client: TestClient):
368358 )
369359
370360 assert response .status_code == 400
371- assert (
372- response .text
373- == '{"detail":"The files in this batch don\' t conform to the schema configs allowed by this model."}'
361+ assert response .json ()["detail" ].startswith (
362+ "The files in this batch don't conform to the schema configs allowed by this model."
374363 )
375364
376365 response = client .post (
@@ -395,56 +384,45 @@ def test_trigger_inference_run(client: TestClient):
395384def test_check_file_types_valid_schema_configs ():
396385 """Test batch schema validation logic."""
397386 file_types1 = [
398- [SchemaType .PDP_COURSE ],
399- [SchemaType .PDP_COHORT ],
387+ [SchemaType .COURSE ],
388+ [SchemaType .STUDENT ],
400389 [SchemaType .UNKNOWN ],
401390 ]
402391 file_types2 = [
403- [SchemaType .SST_PDP_COHORT ],
404- [SchemaType .SST_PDP_COURSE ],
405- [SchemaType .SST_PDP_FINANCE ],
392+ [SchemaType .STUDENT ],
393+ [SchemaType .COURSE ],
406394 ]
407395 file_types3 = [
408- [SchemaType .SST_PDP_COHORT , SchemaType .UNKNOWN ],
409- [SchemaType .SST_PDP_COURSE ],
396+ [SchemaType .STUDENT , SchemaType .UNKNOWN ],
397+ [SchemaType .COURSE ],
410398 ]
411399 file_types4 = [
412- [SchemaType .SST_PDP_COHORT , SchemaType .UNKNOWN ],
400+ [SchemaType .STUDENT , SchemaType .UNKNOWN ],
413401 [SchemaType .UNKNOWN ],
414402 ]
415403 pdp_configs = [
416404 SchemaConfigObj (
417- schema_type = SchemaType .PDP_COURSE ,
405+ schema_type = SchemaType .COURSE ,
418406 optional = False ,
419407 multiple_allowed = False ,
420408 ),
421409 SchemaConfigObj (
422- schema_type = SchemaType .PDP_COHORT ,
410+ schema_type = SchemaType .STUDENT ,
423411 optional = False ,
424412 multiple_allowed = False ,
425413 ),
426- SchemaConfigObj (
427- schema_type = SchemaType .SST_PDP_FINANCE ,
428- optional = True ,
429- multiple_allowed = False ,
430- ),
431414 ]
432415 sst_configs = [
433416 SchemaConfigObj (
434- schema_type = SchemaType .SST_PDP_COHORT ,
417+ schema_type = SchemaType .STUDENT ,
435418 optional = False ,
436419 multiple_allowed = False ,
437420 ),
438421 SchemaConfigObj (
439- schema_type = SchemaType .SST_PDP_COURSE ,
422+ schema_type = SchemaType .COURSE ,
440423 optional = False ,
441424 multiple_allowed = False ,
442425 ),
443- SchemaConfigObj (
444- schema_type = SchemaType .SST_PDP_FINANCE ,
445- optional = True ,
446- multiple_allowed = False ,
447- ),
448426 ]
449427 custom = [
450428 SchemaConfigObj (
@@ -463,10 +441,10 @@ def test_check_file_types_valid_schema_configs():
463441 assert not check_file_types_valid_schema_configs (file_types1 , [custom ])
464442 assert not check_file_types_valid_schema_configs (file_types1 , schema_configs1 )
465443 assert check_file_types_valid_schema_configs (file_types2 , [sst_configs ])
466- assert not check_file_types_valid_schema_configs (file_types2 , [pdp_configs ])
444+ assert check_file_types_valid_schema_configs (file_types2 , [pdp_configs ])
467445 assert not check_file_types_valid_schema_configs (file_types2 , [custom ])
468446 assert check_file_types_valid_schema_configs (file_types3 , [sst_configs ])
469- assert not check_file_types_valid_schema_configs (file_types3 , [pdp_configs ])
447+ assert check_file_types_valid_schema_configs (file_types3 , [pdp_configs ])
470448 assert not check_file_types_valid_schema_configs (file_types3 , [custom ])
471449 assert not check_file_types_valid_schema_configs (file_types4 , [sst_configs ])
472450 assert not check_file_types_valid_schema_configs (file_types4 , [pdp_configs ])
0 commit comments