def test_sample_template_summary_get_req_no_template(self):
     # Test sample template not existing
     obs = sample_template_get_req(self.new_study.id, '*****@*****.**')
     exp = {'status': 'error',
            'message': 'Sample template %d does not exist' %
                       self.new_study.id}
     self.assertEqual(obs, exp)
 def test_sample_template_get_req_no_access(self):
     obs = sample_template_get_req(1, '*****@*****.**')
     exp = {
         'status': 'error',
         'message': 'User does not have access to study'
     }
     self.assertEqual(obs, exp)
Esempio n. 3
0
 def test_sample_template_columns_get_req_no_template(self):
     # Test sample template not existing
     obs = sample_template_get_req(self.new_study.id, '*****@*****.**')
     exp = {'status': 'error',
            'message': 'Sample template %d does not exist' %
                       self.new_study.id}
     self.assertEqual(obs, exp)
 def test_sample_template_get_req_no_template(self):
     obs = sample_template_get_req(self.new_study.id, '*****@*****.**')
     self.assertEqual(
         obs, {
             'status':
             'error',
             'message':
             'Sample template %d does not '
             'exist' % self.new_study.id
         })
Esempio n. 5
0
 def test_sample_template_get_req(self):
     obs = sample_template_get_req(1, '*****@*****.**')
     self.assertCountEqual(obs.keys(), ['status', 'message', 'template'])
     self.assertEqual(obs['status'], 'success')
     self.assertEqual(obs['message'], '')
     self.assertEqual(len(obs['template']), 27)
     self.assertEqual(
         str(obs['template']['1.SKB2.640194']['collection_timestamp']),
         '2011-11-11 13:00:00')
     del obs['template']['1.SKB2.640194']['collection_timestamp']
     self.assertEqual(
         obs['template']['1.SKB2.640194'], {
             'physical_specimen_location': 'ANL',
             'texture': '64.6 sand, 17.6 silt, 17.8 clay',
             'common_name': 'soil metagenome',
             'water_content_soil': '0.164',
             'env_feature': 'ENVO:plant-associated habitat',
             'assigned_from_geo': 'n',
             'altitude': '0',
             'tot_org_carb': '5',
             'env_biome':
             'ENVO:Temperate grasslands, savannas, and shrubland '
             'biome',
             'sample_type': 'ENVO:soil',
             'scientific_name': '1118232',
             'host_taxid': '3483',
             'latitude': '35.2374368957',
             'ph': '6.94',
             'description_duplicate': 'Burmese bulk',
             'elevation': '114',
             'description': 'Cannabis Soil Microbiome',
             'physical_specimen_remaining': 'true',
             'dna_extracted': 'true',
             'taxon_id': '410658',
             'samp_salinity': '7.15',
             'host_subject_id': '1001:B4',
             'season_environment': 'winter',
             'env_package': 'soil',
             'temp': '15',
             'qiita_study_id': '1',
             'country': 'GAZ:United States of America',
             'longitude': '68.5041623253',
             'tot_nitro': '1.41',
             'depth': '0.15',
             'anonymized_name': 'SKB2'
         })
Esempio n. 6
0
 def test_sample_template_get_req(self):
     obs = sample_template_get_req(1, "*****@*****.**")
     self.assertEqual(obs.keys(), ["status", "message", "template"])
     self.assertEqual(obs["status"], "success")
     self.assertEqual(obs["message"], "")
     self.assertEqual(len(obs["template"]), 27)
     self.assertEqual(str(obs["template"]["1.SKB2.640194"]["collection_timestamp"]), "11/11/11 13:00:00")
     del obs["template"]["1.SKB2.640194"]["collection_timestamp"]
     self.assertEqual(
         obs["template"]["1.SKB2.640194"],
         {
             "physical_specimen_location": "ANL",
             "texture": "64.6 sand, 17.6 silt, 17.8 clay",
             "common_name": "soil metagenome",
             "water_content_soil": "0.164",
             "env_feature": "ENVO:plant-associated habitat",
             "assigned_from_geo": "n",
             "altitude": "0",
             "tot_org_carb": "5",
             "env_biome": "ENVO:Temperate grasslands, savannas, and shrubland " "biome",
             "sample_type": "ENVO:soil",
             "scientific_name": "1118232",
             "host_taxid": "3483",
             "latitude": "35.2374368957",
             "ph": "6.94",
             "description_duplicate": "Burmese bulk",
             "elevation": "114",
             "description": "Cannabis Soil Microbiome",
             "physical_specimen_remaining": "true",
             "dna_extracted": "true",
             "taxon_id": "410658",
             "samp_salinity": "7.15",
             "host_subject_id": "1001:B4",
             "season_environment": "winter",
             "temp": "15",
             "qiita_study_id": "1",
             "country": "GAZ:United States of America",
             "longitude": "68.5041623253",
             "tot_nitro": "1.41",
             "depth": "0.15",
             "anonymized_name": "SKB2",
         },
     )
Esempio n. 7
0
 def test_sample_template_get_req(self):
     obs = sample_template_get_req(1, '*****@*****.**')
     self.assertCountEqual(obs.keys(), ['status', 'message', 'template'])
     self.assertEqual(obs['status'], 'success')
     self.assertEqual(obs['message'], '')
     self.assertEqual(len(obs['template']), 27)
     self.assertEqual(str(
         obs['template']['1.SKB2.640194']['collection_timestamp']),
         '2011-11-11 13:00:00')
     del obs['template']['1.SKB2.640194']['collection_timestamp']
     self.assertEqual(obs['template']['1.SKB2.640194'], {
         'physical_specimen_location': 'ANL',
         'texture': '64.6 sand, 17.6 silt, 17.8 clay',
         'common_name': 'soil metagenome',
         'water_content_soil': '0.164',
         'env_feature': 'ENVO:plant-associated habitat',
         'assigned_from_geo': 'n',
         'altitude': '0',
         'tot_org_carb': '5',
         'env_biome': 'ENVO:Temperate grasslands, savannas, and shrubland '
                      'biome',
         'sample_type': 'ENVO:soil',
         'scientific_name': '1118232',
         'host_taxid': '3483',
         'latitude': '35.2374368957',
         'ph': '6.94',
         'description_duplicate': 'Burmese bulk',
         'elevation': '114',
         'description': 'Cannabis Soil Microbiome',
         'physical_specimen_remaining': 'true',
         'dna_extracted': 'true',
         'taxon_id': '410658',
         'samp_salinity': '7.15',
         'host_subject_id': '1001:B4',
         'season_environment': 'winter',
         'env_package': 'soil',
         'temp': '15',
         'qiita_study_id': '1',
         'country': 'GAZ:United States of America',
         'longitude': '68.5041623253',
         'tot_nitro': '1.41',
         'depth': '0.15',
         'anonymized_name': 'SKB2'})
Esempio n. 8
0
 def test_sample_template_summary_get_req_no_template(self):
     # Test sample template not existing
     obs = sample_template_get_req(self.new_study.id, "*****@*****.**")
     exp = {"status": "error", "message": "Sample template %d does not exist" % self.new_study.id}
     self.assertEqual(obs, exp)
Esempio n. 9
0
 def test_sample_template_get_req_no_template(self):
     obs = sample_template_get_req(self.new_study.id, "*****@*****.**")
     self.assertEqual(
         obs, {"status": "error", "message": "Sample template %d does not " "exist" % self.new_study.id}
     )
Esempio n. 10
0
 def test_sample_template_get_req_no_access(self):
     obs = sample_template_get_req(1, "*****@*****.**")
     exp = {"status": "error", "message": "User does not have access to study"}
     self.assertEqual(obs, exp)
 def test_sample_template_get_req_no_template(self):
     obs = sample_template_get_req(self.new_study.id, '*****@*****.**')
     self.assertEqual(obs, {'status': 'error',
                            'message': 'Sample template %d does not '
                            'exist' % self.new_study.id})
 def test_sample_template_get_req_no_access(self):
     obs = sample_template_get_req(1, '*****@*****.**')
     exp = {'status': 'error',
            'message': 'User does not have access to study'}
     self.assertEqual(obs, exp)