From 64f27d52802c9859331de5c87eb10b95736f4411 Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Fri, 22 Feb 2019 12:39:50 -0700 Subject: [PATCH] fix errors --- .../handlers/api_proxy/tests/test_studies.py | 25 +++++++++++++------ 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/qiita_pet/handlers/api_proxy/tests/test_studies.py b/qiita_pet/handlers/api_proxy/tests/test_studies.py index 6fc9faa32..efddbfcda 100644 --- a/qiita_pet/handlers/api_proxy/tests/test_studies.py +++ b/qiita_pet/handlers/api_proxy/tests/test_studies.py @@ -364,10 +364,15 @@ def test_study_files_get_req_multiple(self): 'shared@foo.bar', 1, pt.id, 'per_sample_FASTQ') exp = {'status': 'success', 'num_prefixes': 2, 'artifacts': [], 'remaining': ['uploaded_file.txt'], 'message': '', - 'file_types': [('raw_forward_seqs', True, - ['test_2.R1.fastq.gz', 'test_1.R1.fastq.gz']), - ('raw_reverse_seqs', False, - ['test_2.R2.fastq.gz', 'test_1.R2.fastq.gz'])]} + 'file_types': [ + ('raw_forward_seqs', True, sorted( + ['test_2.R1.fastq.gz', 'test_1.R1.fastq.gz'])), + ('raw_reverse_seqs', False, sorted( + ['test_2.R2.fastq.gz', 'test_1.R2.fastq.gz']))]} + # making sure they are always in the same order + oft = obs['file_types'] + obs['file_types'][0] = (oft[0][0], oft[0][1], sorted(oft[0][2])) + obs['file_types'][1] = (oft[1][0], oft[1][1], sorted(oft[1][2])) self.assertEqual(obs, exp) # let's an extra file that matches @@ -398,11 +403,15 @@ def test_study_files_get_req_multiple(self): 'artifacts': [(1, 'Identification of the Microbiomes for ' 'Cannabis Soils (1) - Raw data 1 (1)')], 'file_types': [ - ('raw_barcodes', True, - ['test_2.R1.fastq.gz', 'test_1.R1.fastq.gz']), - ('raw_forward_seqs', True, - ['test_2.R2.fastq.gz', 'test_1.R2.fastq.gz']), + ('raw_barcodes', True, sorted( + ['test_2.R1.fastq.gz', 'test_1.R1.fastq.gz'])), + ('raw_forward_seqs', True, sorted( + ['test_2.R2.fastq.gz', 'test_1.R2.fastq.gz'])), ('raw_reverse_seqs', False, ['test_1.R3.fastq.gz'])]} + # making sure they are always in the same order + oft = obs['file_types'] + obs['file_types'][0] = (oft[0][0], oft[0][1], sorted(oft[0][2])) + obs['file_types'][1] = (oft[1][0], oft[1][1], sorted(oft[1][2])) self.assertEqual(obs, exp) PREP.delete(pt.id)