def test_abort_error_limit(self): app.config["TESTING"] = True self.app = app.test_client() with self.assertRaises(HTTPException) as http_error: # retrieve current API response to request self.assertEqual( geneInteraction.read_all_to_one_mirna(limit=20000), 404)
def test_abort_error_mimat_number(self): app.config["TESTING"] = True self.app = app.test_client() with self.assertRaises(HTTPException) as http_error: # retrieve current API response to request self.assertEqual( geneInteraction.read_all_to_one_mirna( mimat_number=["MIMATfoobar"]), 404)
def test_abort_error_hs_number(self): app.config["TESTING"] = True self.app = app.test_client() with self.assertRaises(HTTPException) as http_error: # retrieve current API response to request self.assertEqual( geneInteraction.read_all_to_one_mirna( disease_name="bladder urothelial carcinoma", mimat_number=['MIMAT0000062']), 404)
def test_miRNA_Interaction_findSpecific_disease_and_hs_number(self): app.config["TESTING"] = True self.app = app.test_client() # retrieve correct database response to request mock_response = test_read_all_to_one_mirna( disease_name='bladder urothelial carcinoma', hs_number=['hsa-miR-24-3p', 'hsa-miR-96-5p'], limit=50) # retrieve current API response to request api_response = geneInteraction.read_all_to_one_mirna( disease_name='bladder urothelial carcinoma', hs_number=['hsa-miR-24-3p', 'hsa-miR-96-5p'], limit=50) # assert that the two output the same self.assertEqual(mock_response, api_response)