@@ -157,30 +157,6 @@ def test_check_length_hla_type_a(
157157 letter = easyhla .letter , seq = sequence , name = name
158158 )
159159
160- @pytest .mark .integration
161- @pytest .mark .slow
162- def test_run (self , easyhla : EasyHLA ):
163- """
164- Integration test, assert that pyEasyHLA produces an identical output to
165- the original Ruby output.
166- """
167- input_file = os .path .dirname (__file__ ) + "/input/hla-a-seqs.fasta"
168- ref_output_file = os .path .dirname (__file__ ) + "/output/hla-a-output.csv"
169- output_file = os .path .dirname (__file__ ) + "/output/hla-a-test.csv"
170-
171- easyhla .run (
172- easyhla .letter ,
173- input_file ,
174- output_file ,
175- 0 ,
176- )
177-
178- compare_ref_vs_test (
179- easyhla = easyhla ,
180- reference_output_file = ref_output_file ,
181- output_file = output_file ,
182- )
183-
184160 @pytest .mark .parametrize (
185161 "best_matches, exp_ambig, exp_alleles" ,
186162 [
@@ -1129,3 +1105,60 @@ def test_alleles_clean(
11291105 result = easyhla .get_clean_alleles (all_alleles = alleles )
11301106
11311107 assert result == exp_result
1108+
1109+ @pytest .mark .integration
1110+ @pytest .mark .slow
1111+ def test_run (self , easyhla : EasyHLA ):
1112+ """
1113+ Integration test, assert that pyEasyHLA produces an identical output to
1114+ the original Ruby output.
1115+ """
1116+
1117+ input_file = (
1118+ os .path .dirname (__file__ )
1119+ + f"/input/hla-{ easyhla .letter .lower ()} -seqs.fasta"
1120+ )
1121+ ref_output_file = (
1122+ os .path .dirname (__file__ )
1123+ + f"/output/hla-{ easyhla .letter .lower ()} -output-ref.csv"
1124+ )
1125+ output_file = (
1126+ os .path .dirname (__file__ ) + f"/output/hla-{ easyhla .letter .lower ()} -test.csv"
1127+ )
1128+
1129+ if not os .path .exists (input_file ):
1130+ pytest .skip ("Input sequence does not exist!" )
1131+ if not os .path .exists (ref_output_file ):
1132+ pytest .skip ("Reference output does not exist!" )
1133+
1134+ start_time = datetime .now ()
1135+ print (f"Test started at { start_time .isoformat ()} " )
1136+
1137+ easyhla .run (
1138+ easyhla .letter ,
1139+ input_file ,
1140+ output_file ,
1141+ 0 ,
1142+ )
1143+
1144+ end_time = datetime .now ()
1145+
1146+ print (f"Interpretation ended at { end_time .isoformat ()} " )
1147+
1148+ compare_ref_vs_test (
1149+ easyhla = easyhla ,
1150+ reference_output_file = ref_output_file ,
1151+ output_file = output_file ,
1152+ )
1153+
1154+ end_compare_time = datetime .now ()
1155+
1156+ print (f"Test ended at { end_compare_time .isoformat ()} " )
1157+
1158+ print (f"Time elapsed: { (end_compare_time - start_time ).total_seconds ()} " )
1159+ print (
1160+ f"Time elapsed for interpretation: { (end_time - start_time ).total_seconds ()} "
1161+ )
1162+ print (
1163+ f"Time elapsed for output comparison: { (end_compare_time - end_time ).total_seconds ()} "
1164+ )
0 commit comments