def test_abort_error_gene_type(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_gene_network_analysis( gene_type="foobar"), 404)
def test_abort_error_no_data(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_gene_network_analysis( disease_name="bladder urothelial carcinoma", gene_type='lincRNA'), 404)
def test_findceRNA_disease_and_type(self): app.config["TESTING"] = True self.app = app.test_client() # retrieve correct database response to request mock_response = test_read_all_gene_network_analysis( disease_name='bladder urothelial carcinoma', gene_type='protein_coding', limit=50) # retrieve current API response to request api_response = geneInteraction.read_all_gene_network_analysis( disease_name='bladder urothelial carcinoma', gene_type='protein_coding', limit=50) # assert that the two output the same self.assertEqual(mock_response, api_response)