@@ -363,10 +363,9 @@ def test_cannot_create_experiment_that_keywords_has_endogenous_without_method_me
363363 assert response .status_code == 422
364364 response_data = response .json ()
365365 assert (
366- response_data ["detail" ]
367- == "If 'Variant Library Creation Method' is 'Endogenous locus library method', "
368- "both 'Endogenous Locus Library Method System' and 'Endogenous Locus Library Method Mechanism' "
369- "must be present."
366+ response_data ["detail" ] == "If 'Variant Library Creation Method' is 'Endogenous locus library method', "
367+ "both 'Endogenous Locus Library Method System' and 'Endogenous Locus Library Method Mechanism' "
368+ "must be present."
370369 )
371370
372371
@@ -401,10 +400,9 @@ def test_cannot_create_experiment_that_keywords_has_endogenous_without_method_sy
401400 assert response .status_code == 422
402401 response_data = response .json ()
403402 assert (
404- response_data ["detail" ]
405- == "If 'Variant Library Creation Method' is 'Endogenous locus library method', "
406- "both 'Endogenous Locus Library Method System' and 'Endogenous Locus Library Method Mechanism' "
407- "must be present."
403+ response_data ["detail" ] == "If 'Variant Library Creation Method' is 'Endogenous locus library method', "
404+ "both 'Endogenous Locus Library Method System' and 'Endogenous Locus Library Method Mechanism' "
405+ "must be present."
408406 )
409407
410408
@@ -478,10 +476,9 @@ def test_cannot_create_experiment_that_keywords_has_in_vitro_without_method_syst
478476 assert response .status_code == 422
479477 response_data = response .json ()
480478 assert (
481- response_data ["detail" ]
482- == "If 'Variant Library Creation Method' is 'In vitro construct library method', "
483- "both 'In Vitro Construct Library Method System' and 'In Vitro Construct Library Method Mechanism' "
484- "must be present."
479+ response_data ["detail" ] == "If 'Variant Library Creation Method' is 'In vitro construct library method', "
480+ "both 'In Vitro Construct Library Method System' and 'In Vitro Construct Library Method Mechanism' "
481+ "must be present."
485482 )
486483
487484
@@ -516,10 +513,9 @@ def test_cannot_create_experiment_that_keywords_has_in_vitro_without_method_mech
516513 assert response .status_code == 422
517514 response_data = response .json ()
518515 assert (
519- response_data ["detail" ]
520- == "If 'Variant Library Creation Method' is 'In vitro construct library method', "
521- "both 'In Vitro Construct Library Method System' and 'In Vitro Construct Library Method Mechanism' "
522- "must be present."
516+ response_data ["detail" ] == "If 'Variant Library Creation Method' is 'In vitro construct library method', "
517+ "both 'In Vitro Construct Library Method System' and 'In Vitro Construct Library Method Mechanism' "
518+ "must be present."
523519 )
524520
525521
@@ -717,23 +713,28 @@ def test_update_experiment_keywords(session, client, setup_router_db):
717713 assert response .status_code == 200
718714 experiment = response .json ()
719715 experiment_post_payload = experiment .copy ()
720- experiment_post_payload .update ({ "keywords" : [
716+ experiment_post_payload .update (
721717 {
722- "keyword" : {
723- "key" : "Phenotypic Assay Profiling Strategy" ,
724- "label" : "Shotgun sequencing" ,
725- "special" : False ,
726- "description" : "Description"
727- },
728- "description" : "Details of phenotypic assay profiling strategy" ,
729- },
730-
731- ]})
718+ "keywords" : [
719+ {
720+ "keyword" : {
721+ "key" : "Phenotypic Assay Profiling Strategy" ,
722+ "label" : "Shotgun sequencing" ,
723+ "special" : False ,
724+ "description" : "Description" ,
725+ },
726+ "description" : "Details of phenotypic assay profiling strategy" ,
727+ },
728+ ]
729+ }
730+ )
732731 updated_response = client .put (f"/api/v1/experiments/{ experiment ['urn' ]} " , json = experiment_post_payload )
733732 assert updated_response .status_code == 200
734733 updated_experiment = updated_response .json ()
735734 updated_expected_response = deepcopy (TEST_EXPERIMENT_WITH_UPDATE_KEYWORD_RESPONSE )
736- updated_expected_response .update ({"urn" : updated_experiment ["urn" ], "experimentSetUrn" : updated_experiment ["experimentSetUrn" ]})
735+ updated_expected_response .update (
736+ {"urn" : updated_experiment ["urn" ], "experimentSetUrn" : updated_experiment ["experimentSetUrn" ]}
737+ )
737738 assert sorted (updated_expected_response .keys ()) == sorted (updated_experiment .keys ())
738739 for key in updated_experiment :
739740 assert (key , updated_expected_response [key ]) == (key , updated_experiment [key ])
@@ -745,12 +746,21 @@ def test_update_experiment_keywords_case_insensitive(session, client, setup_rout
745746 experiment = create_experiment (client )
746747 experiment_post_payload = experiment .copy ()
747748 # Test database has Delivery Method. The updating keyword's key is delivery method.
748- experiment_post_payload .update ({ "keywords" : [
749+ experiment_post_payload .update (
749750 {
750- "keyword" : {"key" : "delivery method" , "label" : "Other" , "special" : False , "description" : "Description" },
751- "description" : "Details of delivery method" ,
752- },
753- ]})
751+ "keywords" : [
752+ {
753+ "keyword" : {
754+ "key" : "delivery method" ,
755+ "label" : "Other" ,
756+ "special" : False ,
757+ "description" : "Description" ,
758+ },
759+ "description" : "Details of delivery method" ,
760+ },
761+ ]
762+ }
763+ )
754764 response = client .put (f"/api/v1/experiments/{ experiment ['urn' ]} " , json = experiment_post_payload )
755765 response_data = response .json ()
756766 expected_response = deepcopy (TEST_EXPERIMENT_WITH_KEYWORD_RESPONSE )
0 commit comments