updated test cases

parent 34a1d646
Pipeline #130002 passed with stages
in 29 minutes and 24 seconds
......@@ -5,7 +5,7 @@ class AssayTestCase(BaseWebServiceTestCase):
resource = 'assay'
id_property = 'assay_chembl_id'
resource_expected_count = 1221361
resource_expected_count = 1358549
sorting_test_props = ['assay_organism', 'assay_category', 'assay_strain']
mandatory_properties = [
'assay_category',
......@@ -59,8 +59,8 @@ class AssayTestCase(BaseWebServiceTestCase):
'target_chembl_id': 'CHEMBL3938',
'assay_type__iregex': '(B|F)',
})
self.assertGreaterEqual(assay_list_req['page_meta']['total_count'], 50)
self.assertLessEqual(assay_list_req['page_meta']['total_count'], 100)
self.assertGreaterEqual(assay_list_req['page_meta']['total_count'], 100)
self.assertLessEqual(assay_list_req['page_meta']['total_count'], 200)
for act_i in assay_list_req[self.get_current_plural()]:
self.assertEqual(act_i['target_chembl_id'], 'CHEMBL3938')
self.assertIn(act_i['assay_type'], {'B', 'F'})
......
......@@ -5,7 +5,7 @@ class ATCClassTestCase(BaseWebServiceTestCase):
resource = 'atc_class'
id_property = 'level5'
resource_expected_count = 4966
resource_expected_count = 5064
sorting_test_props = ['level4', 'level4_description', 'level5']
mandatory_properties = [
'level1',
......
......@@ -7,7 +7,7 @@ class CompoundTestCase(BaseWebServiceTestCase):
resource = 'molecule'
id_property = 'molecule_chembl_id'
resource_expected_count = 1961462
resource_expected_count = 2086898
sorting_test_props = ['pref_name']
mandatory_properties = [
'atc_classifications',
......
......@@ -21,7 +21,7 @@ class CompoundByStructureTestCase(BaseWebServiceTestCase):
resource = 'molecule'
id_property = 'molecule_chembl_id'
resource_expected_count = 1961462
resource_expected_count = 2086898
sorting_test_props = ['pref_name']
mandatory_properties = [
'atc_classifications',
......
......@@ -5,7 +5,7 @@ class CompoundRecordTestCase(BaseWebServiceTestCase):
resource = 'compound_record'
id_property = 'record_id'
resource_expected_count = 2444828
resource_expected_count = 2680904
sorting_test_props = ['compound_name']
mandatory_properties = [
'compound_key',
......
......@@ -4,7 +4,7 @@ class DocumentTestCase(BaseWebServiceTestCase):
resource = 'document'
id_property = 'document_chembl_id'
resource_expected_count = 76086
resource_expected_count = 80480
sorting_test_props = ['title']
mandatory_properties = [
'abstract',
......
......@@ -4,32 +4,34 @@ class DrugTestCase(BaseWebServiceTestCase):
resource = 'drug'
id_property = 'molecule_chembl_id'
resource_expected_count = 13308
resource_expected_count = 13721
sorting_test_props = ['sc_patent', 'ob_patent']
mandatory_properties = [
'applicants',
'availability_type',
'black_box',
'chirality',
'development_phase',
'drug_type',
'first_approval',
'first_in_class',
'indication_class',
'molecule_chembl_id',
'ob_patent',
'oral',
'parenteral',
'prodrug',
'research_codes',
'rule_of_five',
'sc_patent',
'synonyms',
'topical',
'usan_stem',
'usan_stem_definition',
'usan_stem_substem',
'usan_year',
'applicants',
'availability_type',
'black_box',
'black_box_warning',
'chirality',
'development_phase',
'drug_type',
'first_approval',
'first_in_class',
'indication_class',
'molecule_chembl_id',
'ob_patent',
'oral',
'parenteral',
'prodrug',
'research_codes',
'rule_of_five',
'sc_patent',
'synonyms',
'topical',
'usan_stem',
'usan_stem_definition',
'usan_stem_substem',
'usan_year',
'withdrawn_flag',
]
def test_filtered_lists(self):
......
......@@ -6,11 +6,11 @@ class GeneralTestCase(BaseWebServiceTestCase):
def test_status(self):
status_res = self.request_url(self.WS_URL + '/status.json')
message = 'Invalid status response!'
self.assertEqual(status_res['activities'], 16066124, message)
self.assertEqual(status_res['chembl_db_version'], 'ChEMBL_27', message)
self.assertEqual(status_res['chembl_release_date'], '2020-05-18T00:00:00', message)
self.assertEqual(status_res['compound_records'], 2444828, message)
self.assertEqual(status_res['disinct_compounds'], 1961462, message)
self.assertEqual(status_res['publications'], 76086, message)
self.assertEqual(status_res['activities'], 17276334, message)
self.assertEqual(status_res['chembl_db_version'], 'ChEMBL_28', message)
self.assertEqual(status_res['chembl_release_date'], '2021-01-15T00:00:00', message)
self.assertEqual(status_res['compound_records'], 2680904, message)
self.assertEqual(status_res['disinct_compounds'], 2086898, message)
self.assertEqual(status_res['publications'], 80480, message)
self.assertEqual(status_res['status'], 'UP', message)
self.assertEqual(status_res['targets'], 13382, message)
self.assertEqual(status_res['targets'], 14347, message)
......@@ -4,14 +4,14 @@ from chembl_webservices.tests import BaseWebServiceTestCase
class ImagesTestCase(BaseWebServiceTestCase):
def test_compound_structural_alert(self):
self.get_resource_by_id('compound_structural_alert', 34534481, custom_format='png',
self.get_resource_by_id('compound_structural_alert', 45611901, custom_format='png',
expected_code=400)
self.get_resource_by_id('compound_structural_alert', 34534482, custom_format='png',
self.get_resource_by_id('compound_structural_alert', 45611902, custom_format='png',
expected_code=400)
image_binary = self.get_resource_by_id('compound_structural_alert', 34534481, custom_format='svg')
image_binary = self.get_resource_by_id('compound_structural_alert', 45611901, custom_format='svg')
self.assertTrue(image_binary.startswith("<?xml version='1.0' encoding='iso-8859-1'?>\n<svg version='1.1'"))
image_binary = self.get_resource_by_id('compound_structural_alert', 34534482, custom_format='svg')
image_binary = self.get_resource_by_id('compound_structural_alert', 45611902, custom_format='svg')
self.assertTrue(image_binary.startswith("<?xml version='1.0' encoding='iso-8859-1'?>\n<svg version='1.1'"))
def test_molecule(self):
......
......@@ -5,24 +5,26 @@ class BindingSiteTestCase(BaseWebServiceTestCase):
resource = 'binding_site'
id_property = 'site_id'
resource_expected_count = 14342
resource_expected_count = 21777
sorting_test_props = ['site_name']
mandatory_properties = [
'site_name',
'site_components'
]
class BiotherapeuticTestCase(BaseWebServiceTestCase):
resource = 'biotherapeutic'
id_property = 'molecule_chembl_id'
resource_expected_count = 22925
resource_expected_count = 22946
sorting_test_props = ['helm_notation']
mandatory_properties = [
'molecule_chembl_id',
'helm_notation'
]
class GoSlimTestCase(BaseWebServiceTestCase):
resource = 'go_slim'
......@@ -43,7 +45,7 @@ class MetabolismTestCase(BaseWebServiceTestCase):
resource = 'metabolism'
id_property = 'met_id'
resource_expected_count = 1245
resource_expected_count = 2162
sorting_test_props = ['metabolite_name']
mandatory_properties = [
'drug_chembl_id',
......@@ -68,7 +70,7 @@ class TissueTestCase(BaseWebServiceTestCase):
resource = 'tissue'
id_property = 'tissue_chembl_id'
resource_expected_count = 707
resource_expected_count = 739
sorting_test_props = ['pref_name']
mandatory_properties = [
'tissue_chembl_id',
......@@ -81,7 +83,7 @@ class TargetRelationsTestCase(BaseWebServiceTestCase):
resource = 'target_relation'
id_property = 'target_chembl_id'
resource_expected_count = 9610
resource_expected_count = 16999
sorting_test_props = []
mandatory_properties = [
'target_chembl_id',
......@@ -94,7 +96,7 @@ class CellLineTestCase(BaseWebServiceTestCase):
resource = 'cell_line'
id_property = 'cell_chembl_id'
resource_expected_count = 1831
resource_expected_count = 1950
sorting_test_props = ['cell_source_tissue', 'cell_source_organism']
mandatory_properties = [
'cell_chembl_id',
......@@ -112,7 +114,7 @@ class DrugIndicationTestCase(BaseWebServiceTestCase):
resource = 'drug_indication'
id_property = 'drugind_id'
resource_expected_count = 37259
resource_expected_count = 42988
sorting_test_props = ['mesh_heading', 'efo_term']
mandatory_properties = [
'drugind_id',
......@@ -129,7 +131,7 @@ class DocumentSimilarityTestCase(BaseWebServiceTestCase):
resource = 'document_similarity'
id_property = 'document_1_chembl_id'
resource_expected_count = 566597
resource_expected_count = 587666
sorting_test_props = ['tid_tani', 'mol_tani']
mandatory_properties = [
'document_1_chembl_id',
......@@ -143,7 +145,7 @@ class CompoundStructuralAlertTestCase(BaseWebServiceTestCase):
resource = 'compound_structural_alert'
id_property = 'cpd_str_alert_id'
resource_expected_count = 3691907
resource_expected_count = 3692285
sorting_test_props = ['alert__alertset__priority']
mandatory_properties = [
'alert',
......@@ -156,7 +158,7 @@ class OrganismTestCase(BaseWebServiceTestCase):
resource = 'organism'
id_property = 'oc_id'
resource_expected_count = 3961
resource_expected_count = 4043
sorting_test_props = ['l1', 'l2', 'l3']
mandatory_properties = [
'l1',
......@@ -170,7 +172,7 @@ class MoleculeFormTestCase(BaseWebServiceTestCase):
resource = 'molecule_form'
id_property = 'molecule_chembl_id'
resource_expected_count = 1875859
resource_expected_count = 2005324
mandatory_properties = [
'is_parent',
'molecule_chembl_id',
......@@ -181,7 +183,7 @@ class SourceTestCase(BaseWebServiceTestCase):
resource = 'source'
id_property = 'src_id'
resource_expected_count = 48
resource_expected_count = 50
mandatory_properties = [
'src_description',
'src_id',
......@@ -192,7 +194,7 @@ class TargetComponentTestCase(BaseWebServiceTestCase):
resource = 'target_component'
id_property = 'component_id'
resource_expected_count = 9758
resource_expected_count = 10370
mandatory_properties = [
'accession',
'component_id',
......@@ -215,7 +217,7 @@ class ChemblIdLookUpTestCase(BaseWebServiceTestCase):
resource = 'chembl_id_lookup'
id_property = 'chembl_id'
resource_expected_count = 3687712
resource_expected_count = 3956726
mandatory_properties = [
'chembl_id',
'entity_type',
......
......@@ -5,7 +5,7 @@ class TargetTestCase(BaseWebServiceTestCase):
resource = 'target'
id_property = 'target_chembl_id'
resource_expected_count = 13382
resource_expected_count = 14347
sorting_test_props = ['pref_name']
def test_target_by_id(self):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment