def test_abort_error_gene_symbol(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_mirna_for_specific_interaction(
                    gene_symbol=["foobar"], between=True), 404)
Exemple #2
0
    def test_abort_error_ensg_and_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_mirna_for_specific_interaction(
                    ensg_number=["ENSGfoobar"], gene_type="foobar"), 404)
Exemple #3
0
    def test_abort_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_mirna_for_specific_interaction(
                    disease_name="bladder urothelial carcinoma",
                    gene_type='lincRNA'), 404)
Exemple #4
0
    def test_miRNAInteraction_findceRNA_disease_and_type(self):
        app.config["TESTING"] = True
        self.app = app.test_client()

        # retrieve correct database response to request
        mock_response = test_read_mirna_for_specific_interaction(
            disease_name='bladder urothelial carcinoma',
            gene_type='protein_coding')

        # retrieve current API response to request
        api_response = geneInteraction.read_mirna_for_specific_interaction(
            disease_name='bladder urothelial carcinoma',
            gene_type='protein_coding')
        # assert that the two output the same
        self.assertEqual(mock_response, api_response)
Exemple #5
0
    def test_miRNAInteraction_findceRNA_disease_and_ensg(self):
        app.config["TESTING"] = True
        self.app = app.test_client()

        # retrieve correct database response to request
        mock_response = test_read_mirna_for_specific_interaction(
            disease_name='bladder urothelial carcinoma',
            ensg_number=['ENSG00000007312', 'ENSG00000113657'])

        # retrieve current API response to request
        api_response = geneInteraction.read_mirna_for_specific_interaction(
            disease_name='bladder urothelial carcinoma',
            ensg_number=['ENSG00000007312', 'ENSG00000113657'])

        # assert that the two output the same
        self.assertEqual(mock_response, api_response)
    def test_miRNAInteraction_findceRNA_disease_and_symbol(self):
        app.config["TESTING"] = True
        self.app = app.test_client()

        # retrieve correct database response to request
        mock_response = test_read_mirna_for_specific_interaction(
            disease_name='head and neck squamous cell carcinoma',
            gene_symbol=['CFTR', 'AOC1'],
            between=True)

        # retrieve current API response to request
        api_response = geneInteraction.read_mirna_for_specific_interaction(
            disease_name='head and neck squamous cell carcinoma',
            gene_symbol=['CFTR', 'AOC1'],
            between=True)

        # assert that the two output the same
        self.assertEqual(mock_response, api_response)