def test_prep_template_get_req_no_access(self): obs = prep_template_get_req(1, '*****@*****.**') exp = { 'status': 'error', 'message': 'User does not have access to study' } self.assertEqual(obs, exp)
def test_prep_template_get_req(self): obs = prep_template_get_req(1, '*****@*****.**') self.assertCountEqual( list(obs.keys()), ['status', 'message', 'template']) self.assertEqual(obs['status'], 'success') self.assertEqual(obs['message'], '') self.assertCountEqual(obs['template'].keys(), [ '1.SKB2.640194', '1.SKM4.640180', '1.SKB3.640195', '1.SKB6.640176', '1.SKD6.640190', '1.SKM6.640187', '1.SKD9.640182', '1.SKM8.640201', '1.SKM2.640199', '1.SKD2.640178', '1.SKB7.640196', '1.SKD4.640185', '1.SKB8.640193', '1.SKM3.640197', '1.SKD5.640186', '1.SKB1.640202', '1.SKM1.640183', '1.SKD1.640179', '1.SKD3.640198', '1.SKB5.640181', '1.SKB4.640189', '1.SKB9.640200', '1.SKM9.640192', '1.SKD8.640184', '1.SKM5.640177', '1.SKM7.640188', '1.SKD7.640191']) self.assertEqual(obs['template']['1.SKD7.640191'], { 'experiment_center': 'ANL', 'center_name': 'ANL', 'run_center': 'ANL', 'run_prefix': 's_G1_L001_sequences', 'primer': 'GTGCCAGCMGCCGCGGTAA', 'target_gene': '16S rRNA', 'sequencing_meth': 'Sequencing by synthesis', 'run_date': '8/1/12', 'platform': 'Illumina', 'pcr_primers': 'FWD:GTGCCAGCMGCCGCGGTAA; REV:GGACTACHVGGGTWTCTAAT', 'library_construction_protocol': 'This analysis was done as in Caporaso et al 2011 Genome ' 'research. The PCR primers (F515/R806) were developed against ' 'the V4 region of the 16S rRNA (both bacteria and archaea), ' 'which we determined would yield optimal community clustering ' 'with reads of this length using a procedure similar to that ' 'of ref. 15. [For reference, this primer pair amplifies the ' 'region 533_786 in the Escherichia coli strain 83972 sequence ' '(greengenes accession no. prokMSA_id:470367).] The reverse ' 'PCR primer is barcoded with a 12-base error-correcting Golay ' 'code to facilitate multiplexing of up to 1,500 samples per ' 'lane, and both PCR primers contain sequencer adapter ' 'regions.', 'experiment_design_description': 'micro biome of soil and rhizosphere of cannabis plants ' 'from CA', 'study_center': 'CCME', 'center_project_name': None, 'sample_center': 'ANL', 'samp_size': '.25,g', 'barcode': 'ACGCACATACAA', 'qiita_prep_id': '1', 'emp_status': 'EMP', 'illumina_technology': 'MiSeq', 'experiment_title': 'Cannabis Soil Microbiome', 'target_subfragment': 'V4', 'instrument_model': 'Illumina MiSeq'})
def test_prep_template_get_req(self): obs = prep_template_get_req(1, '*****@*****.**') self.assertItemsEqual(obs.keys(), ['status', 'message', 'template']) self.assertEqual(obs['status'], 'success') self.assertEqual(obs['message'], '') self.assertEqual(obs['template'].keys(), [ '1.SKB2.640194', '1.SKM4.640180', '1.SKB3.640195', '1.SKB6.640176', '1.SKD6.640190', '1.SKM6.640187', '1.SKD9.640182', '1.SKM8.640201', '1.SKM2.640199', '1.SKD2.640178', '1.SKB7.640196', '1.SKD4.640185', '1.SKB8.640193', '1.SKM3.640197', '1.SKD5.640186', '1.SKB1.640202', '1.SKM1.640183', '1.SKD1.640179', '1.SKD3.640198', '1.SKB5.640181', '1.SKB4.640189', '1.SKB9.640200', '1.SKM9.640192', '1.SKD8.640184', '1.SKM5.640177', '1.SKM7.640188', '1.SKD7.640191']) self.assertEqual(obs['template']['1.SKD7.640191'], { 'experiment_center': 'ANL', 'center_name': 'ANL', 'run_center': 'ANL', 'run_prefix': 's_G1_L001_sequences', 'primer': 'GTGCCAGCMGCCGCGGTAA', 'target_gene': '16S rRNA', 'sequencing_meth': 'Sequencing by synthesis', 'run_date': '8/1/12', 'platform': 'Illumina', 'pcr_primers': 'FWD:GTGCCAGCMGCCGCGGTAA; REV:GGACTACHVGGGTWTCTAAT', 'library_construction_protocol': 'This analysis was done as in Caporaso et al 2011 Genome ' 'research. The PCR primers (F515/R806) were developed against ' 'the V4 region of the 16S rRNA (both bacteria and archaea), ' 'which we determined would yield optimal community clustering ' 'with reads of this length using a procedure similar to that ' 'of ref. 15. [For reference, this primer pair amplifies the ' 'region 533_786 in the Escherichia coli strain 83972 sequence ' '(greengenes accession no. prokMSA_id:470367).] The reverse ' 'PCR primer is barcoded with a 12-base error-correcting Golay ' 'code to facilitate multiplexing of up to 1,500 samples per ' 'lane, and both PCR primers contain sequencer adapter ' 'regions.', 'experiment_design_description': 'micro biome of soil and rhizosphere of cannabis plants ' 'from CA', 'study_center': 'CCME', 'center_project_name': None, 'sample_center': 'ANL', 'samp_size': '.25,g', 'barcode': 'ACGCACATACAA', 'qiita_prep_id': '1', 'emp_status': 'EMP', 'illumina_technology': 'MiSeq', 'experiment_title': 'Cannabis Soil Microbiome', 'target_subfragment': 'V4', 'instrument_model': 'Illumina MiSeq'})
def test_prep_template_get_req_no_exists(self): obs = prep_template_get_req(3100, '*****@*****.**') self.assertEqual(obs, {'status': 'error', 'message': 'Prep template 3100 does not exist'})
def test_prep_template_get_req_no_access(self): obs = prep_template_get_req(1, '*****@*****.**') exp = {'status': 'error', 'message': 'User does not have access to study'} self.assertEqual(obs, exp)
def test_prep_template_get_req_no_exists(self): obs = prep_template_get_req(3100, '*****@*****.**') self.assertEqual(obs, { 'status': 'error', 'message': 'Prep template 3100 does not exist' })