Skip to content

Commit c07a2d7

Browse files
author
Nicholas Youngblut
committed
fixed output path issue for HtReads tests
1 parent b10c46d commit c07a2d7

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

tests/test_HtReads.py

+14-8
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,18 @@
2121
tmp_dir = os.path.join(test_dir, 'tmp')
2222
out_dir = os.path.join(test_dir, 'output')
2323

24-
def validate_fastq(data_dir):
24+
def validate_fastq(base_dir):
2525
# validating fastq
26-
output_R = os.path.join(data_dir, 'TEST', '1', 'R1.fq')
26+
## Read1
27+
output_R = os.path.join(base_dir, '1', 'R1.fq')
28+
if not os.path.isfile(output_R):
29+
raise IOError('Cannot find file: {}'.format(output_R))
2730
ret = subprocess.run(['fqtools', 'validate', output_R])
2831
assert ret.returncode == 0
29-
output_R = os.path.join(data_dir, 'TEST', '1', 'R2.fq')
32+
## Read2
33+
output_R = os.path.join(base_dir, '1', 'R2.fq')
34+
if not os.path.isfile(output_R):
35+
raise IOError('Cannot find file: {}'.format(output_R))
3036
ret = subprocess.run(['fqtools', 'validate', output_R])
3137
assert ret.returncode == 0
3238

@@ -57,7 +63,7 @@ def test_main(script_runner):
5763
'--rndSeed', '8294',
5864
genome_table, abund_table, output_prefix)
5965
assert ret.success
60-
validate_fastq(data_dir)
66+
validate_fastq(output_prefix)
6167

6268
def test_main_multi(script_runner):
6369
genome_table = os.path.join(data_dir, 'genome_list.txt')
@@ -72,7 +78,7 @@ def test_main_multi(script_runner):
7278
'--rndSeed', '8294',
7379
genome_table, abund_table, output_prefix)
7480
assert ret.success
75-
validate_fastq(data_dir)
81+
validate_fastq(output_prefix)
7682

7783
def test_main_zeros(script_runner):
7884
genome_table = os.path.join(data_dir, 'genome_list.txt')
@@ -88,7 +94,7 @@ def test_main_zeros(script_runner):
8894
'--rndSeed', '8294',
8995
genome_table, abund_table, output_prefix)
9096
assert ret.success
91-
validate_fastq(data_dir)
97+
validate_fastq(output_prefix)
9298

9399
def test_main_prefix(script_runner):
94100
genome_table = os.path.join(data_dir, 'genome_list.txt')
@@ -105,7 +111,7 @@ def test_main_prefix(script_runner):
105111
'--rndSeed', '8294',
106112
genome_table, abund_table, output_prefix)
107113
assert ret.success
108-
validate_fastq(data_dir)
114+
validate_fastq(output_prefix)
109115

110116
def test_main_large_frag_sd(script_runner):
111117
genome_table = os.path.join(data_dir, 'genome_list.txt')
@@ -122,4 +128,4 @@ def test_main_large_frag_sd(script_runner):
122128
'--seq-depth', '5e3',
123129
genome_table, abund_table, output_prefix)
124130
assert ret.success
125-
validate_fastq(data_dir)
131+
validate_fastq(output_prefix)

0 commit comments

Comments
 (0)