@@ -488,11 +488,9 @@ def test_that_store_maf_in_bed_filtered_variants_has_expected_calls(syn):
488488 [
489489 (True , False , False ),
490490 (False , False , False ),
491+ (False , True , False ),
491492 ],
492- ids = [
493- "testing_mode" ,
494- "prod_mode" ,
495- ],
493+ ids = ["testing_mode" , "prod_mode" , "staging_mode" ],
496494)
497495def test_that_mutation_in_cis_filter_has_expected_calls_when_mutations_in_cis_is_not_skipped (
498496 syn , test , staging , skip_mutations_in_cis
@@ -544,7 +542,7 @@ def test_that_mutation_in_cis_filter_has_expected_calls_when_mutations_in_cis_is
544542 staging = staging ,
545543 )
546544 # check expected calls with expected params
547- patch_get_cmd .assert_called_once_with (test = test )
545+ patch_get_cmd .assert_called_once_with (test = test , staging = staging )
548546 patch_check_call .assert_called_once_with ("test_cmd" )
549547 patch_store_mutation_in_cis_files .assert_called_once_with (
550548 syn = syn ,
@@ -592,13 +590,11 @@ def test_that_mutation_in_cis_filter_has_expected_calls_when_mutations_in_cis_is
592590 [
593591 (True , False , True ),
594592 (False , False , True ),
595- (False , True , False ),
596593 (False , True , True ),
597594 ],
598595 ids = [
599596 "testing_mode_skip_mutations_in_cis" ,
600597 "prod_mode_skip_mutations_in_cis" ,
601- "staging_mode" ,
602598 "staging_mode_skip_mutations_in_cis" ,
603599 ],
604600)
@@ -692,32 +688,54 @@ def test_that_mutation_in_cis_filter_has_expected_calls_when_mutations_in_cis_is
692688
693689
694690@pytest .mark .parametrize (
695- "test, expected_cmd" ,
691+ "test, staging, expected_cmd" ,
696692 [
697693 (
698694 True ,
695+ False ,
699696 [
700697 "Rscript" ,
701698 "/home/test_dir/Genie/../R/mergeCheck.R" ,
702699 "--testing" ,
703700 ],
704701 ),
705702 (
703+ False ,
706704 False ,
707705 [
708706 "Rscript" ,
709707 "/home/test_dir/Genie/../R/mergeCheck.R" ,
710708 ],
711709 ),
710+ (
711+ False ,
712+ True ,
713+ ["Rscript" , "/home/test_dir/Genie/../R/mergeCheck.R" , "--staging" ],
714+ ),
712715 ],
713- ids = ["testing_mode" , "prod_mode" ],
716+ ids = ["testing_mode" , "prod_mode" , "staging_mode" ],
714717)
715- def test_that_get_mutation_in_cis_filter_cmd_returns_correct_cmd (test , expected_cmd ):
718+ def test_that_get_mutation_in_cis_filter_cmd_returns_correct_cmd (
719+ test , staging , expected_cmd
720+ ):
716721 with patch .object (os .path , "dirname" , return_value = "/home/test_dir/Genie/" ):
717- cmd = database_to_staging .get_mutation_in_cis_filter_script_cmd (test = test )
722+ cmd = database_to_staging .get_mutation_in_cis_filter_script_cmd (
723+ test = test , staging = staging
724+ )
718725 assert cmd == expected_cmd
719726
720727
728+ def test_that_get_mutation_in_cis_filter_cmd_raises_value_error ():
729+ with patch .object (os .path , "dirname" , return_value = "/home/test_dir/Genie/" ):
730+ with pytest .raises (
731+ ValueError ,
732+ match = "Mutation in cis only available in staging or testing mode not both" ,
733+ ):
734+ database_to_staging .get_mutation_in_cis_filter_script_cmd (
735+ test = True , staging = True
736+ )
737+
738+
721739@pytest .mark .parametrize (
722740 "flagged_df, expected_flagged_variants" ,
723741 [
0 commit comments