コード例 #1
0
    def test_abort_error_disease(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(
                expressionValues.get_mirna_expr(disease_name="foobar"), 404)
コード例 #2
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(
                expressionValues.get_mirna_expr(
                    hs_number=["hs-foobar", "hs-barfoo"]), 404)
コード例 #3
0
    def test_get_expr_hs_number(self):
        app.config["TESTING"] = True
        self.app = app.test_client()

        # retrieve correct database response to request
        mock_response = test_get_mirna_expr(
            disease_name='bladder urothelial carcinoma',
            hs_number=['hsa-let-7a-5p'])

        # retrieve current API response to request
        api_response = expressionValues.get_mirna_expr(
            disease_name='bladder urothelial carcinoma',
            hs_number=['hsa-let-7a-5p'])

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