Skip to content

Commit fa4a68b

Browse files
committed
Fixing qiita ware tests
1 parent e75c372 commit fa4a68b

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

qiita_ware/test/test_processing_pipeline.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -242,19 +242,20 @@ def test_get_preprocess_fasta_cmd_sff_run_prefix(self):
242242
def test_get_preprocess_fasta_cmd_sff_run_prefix_match(self):
243243
# Test that the run prefixes in the prep_template and the file names
244244
# actually match and raise an error if not
245+
new_fp_id = get_count('qiita.filepath') + 1
245246
conn_handler = SQLConnectionHandler()
246247
sql = ("""
247248
INSERT INTO qiita.filepath (filepath_id, filepath,
248249
filepath_type_id, checksum, checksum_algorithm_id,
249-
data_directory_id) VALUES (19, '1_new.sff', 17, 852952723, 1,
250+
data_directory_id) VALUES (%s, '1_new.sff', 17, 852952723, 1,
250251
5);
251252
INSERT INTO qiita.raw_filepath (raw_data_id , filepath_id) VALUES
252-
(3, 19);
253+
(3, %s);
253254
UPDATE qiita.prep_1 SET run_prefix='preprocess_test';
254255
UPDATE qiita.prep_1 SET run_prefix='new' WHERE
255256
sample_id = '1.SKB8.640193';
256257
""")
257-
conn_handler.execute(sql)
258+
conn_handler.execute(sql, (new_fp_id, new_fp_id))
258259

259260
raw_data = RawData(3)
260261
params = Preprocessed454Params(1)
@@ -287,25 +288,27 @@ def test_get_preprocess_fasta_cmd_sff_run_prefix_match(self):
287288
def test_get_preprocess_fasta_cmd_sff_run_prefix_match_error_1(self):
288289
# Test that the run prefixes in the prep_template and the file names
289290
# actually match and raise an error if not
291+
fp_count = get_count('qiita.filepath')
290292
conn_handler = SQLConnectionHandler()
291293
sql = ("""
292294
INSERT INTO qiita.filepath (filepath_id, filepath,
293295
filepath_type_id, checksum, checksum_algorithm_id,
294-
data_directory_id) VALUES (19, '1_new.sff', 17, 852952723, 1,
296+
data_directory_id) VALUES (%s, '1_new.sff', 17, 852952723, 1,
295297
5);
296298
INSERT INTO qiita.raw_filepath (raw_data_id , filepath_id) VALUES
297-
(3, 19);
299+
(3, %s);
298300
INSERT INTO qiita.filepath (filepath_id, filepath,
299301
filepath_type_id, checksum, checksum_algorithm_id,
300-
data_directory_id) VALUES (20, '1_error.sff', 17, 852952723,
302+
data_directory_id) VALUES (%s, '1_error.sff', 17, 852952723,
301303
1, 5);
302304
INSERT INTO qiita.raw_filepath (raw_data_id , filepath_id) VALUES
303-
(3, 20);
305+
(3, %s);
304306
UPDATE qiita.prep_1 SET run_prefix='preprocess_test';
305307
UPDATE qiita.prep_1 SET run_prefix='new' WHERE
306308
sample_id = '1.SKB8.640193';
307309
""")
308-
conn_handler.execute(sql)
310+
conn_handler.execute(
311+
sql, (fp_count + 1, fp_count + 1, fp_count + 2, fp_count + 2))
309312

310313
raw_data = RawData(3)
311314
params = Preprocessed454Params(1)

0 commit comments

Comments
 (0)