Exemplo n.º 1
0
    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_mirna(hs_number=["hs-foobar"]), 404)
Exemplo n.º 2
0
    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_mirna(disease_name="foobar",
                                               limit=20000), 404)
Exemplo n.º 3
0
    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_mirna(
                    disease_name="bladder urothelial carcinoma",
                    mimat_number=['MIMAT0004482']), 404)
Exemplo n.º 4
0
    def test_abort_error_mimat_and_hs_number(self):
        app.config["TESTING"] = True
        self.app = app.test_client()
        self.app = app.test_client()

        with self.assertRaises(HTTPException) as http_error:
            # retrieve current API response to request
            self.assertEqual(
                geneInteraction.read_all_mirna(
                    disease_name="head and neck squamous cell carcinoma",
                    mimat_number=['MIMAT0000062'],
                    hs_number=['hsa-let-7a-5p']), 404)
Exemplo n.º 5
0
    def test_miRNA_Interaction_getOccurences_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_mirna(
            disease_name='bladder urothelial carcinoma',
            hs_number=['hsa-miR-24-3p', 'hsa-miR-96-5p'],
            occurences=500,
            limit=50)

        # retrieve current API response to request
        api_response = geneInteraction.read_all_mirna(
            disease_name='bladder urothelial carcinoma',
            hs_number=['hsa-miR-24-3p', 'hsa-miR-96-5p'],
            occurences=500,
            limit=50)
        # assert that the two output the same
        self.assertEqual(mock_response, api_response)
Exemplo n.º 6
0
    def test_miRNA_Interaction_getOccurences_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_mirna(
            disease_name='head and neck squamous cell carcinoma',
            hs_number=['hsa-let-7c-3p', 'hsa-let-7f-1-3p'],
            occurences=10,
            limit=50)

        # retrieve current API response to request
        api_response = geneInteraction.read_all_mirna(
            disease_name='head and neck squamous cell carcinoma',
            hs_number=['hsa-let-7c-3p', 'hsa-let-7f-1-3p'],
            occurences=10,
            limit=50)
        # assert that the two output the same
        self.assertEqual(mock_response, api_response)
Exemplo n.º 7
0
    def test_miRNA_Interaction_getOccurences_disease_and_mimat_number(self):
        app.config["TESTING"] = True
        self.app = app.test_client()

        # retrieve correct database response to request
        mock_response = test_read_all_mirna(
            disease_name='head and neck squamous cell carcinoma',
            mimat_number=['MIMAT0026472', 'MIMAT0004486'],
            occurences=10,
            sorting="occurences",
            limit=50)

        # retrieve current API response to request
        api_response = geneInteraction.read_all_mirna(
            disease_name='head and neck squamous cell carcinoma',
            mimat_number=['MIMAT0026472', 'MIMAT0004486'],
            occurences=10,
            sorting="occurences",
            limit=50)
        # assert that the two output the same
        self.assertEqual(mock_response, api_response)
Exemplo n.º 8
0
    def test_miRNA_Interaction_getOccurences_disease_and_mimat_number_sorting_desc(
            self):
        app.config["TESTING"] = True
        self.app = app.test_client()

        # retrieve correct database response to request
        mock_response = test_read_all_mirna(
            disease_name='bladder urothelial carcinoma',
            mimat_number=['MIMAT0000080', 'MIMAT0000095'],
            occurences=500,
            limit=50,
            sorting="occurences",
            descending=True)

        # retrieve current API response to request
        api_response = geneInteraction.read_all_mirna(
            disease_name='bladder urothelial carcinoma',
            mimat_number=['MIMAT0000080', 'MIMAT0000095'],
            occurences=500,
            sorting="occurences",
            limit=50,
            descending=True)
        # assert that the two output the same
        self.assertEqual(mock_response, api_response)