|
1 | 1 | # Copyright (c) Microsoft Corporation. All rights reserved.
|
2 | 2 | # Licensed under the MIT License.
|
| 3 | +from abc import ABC |
3 | 4 | import inspect
|
4 | 5 | import json
|
5 | 6 | import unittest
|
|
11 | 12 | TIMER_TRIGGER
|
12 | 13 | from azure.functions.decorators.core import DataType, AuthLevel, \
|
13 | 14 | BindingDirection, SCRIPT_FILE_NAME
|
14 |
| -from azure.functions.decorators.function_app import BindingApi, \ |
15 |
| - FunctionBuilder, FunctionApp, Function, Blueprint, DecoratorApi, \ |
16 |
| - AsgiFunctionApp, WsgiFunctionApp, HttpFunctionsAuthLevelMixin, \ |
17 |
| - FunctionRegister, TriggerApi, ExternalHttpFunctionApp |
| 15 | +from azure.functions.decorators.function_app import ( |
| 16 | + BindingApi, FunctionBuilder, FunctionApp, Function, Blueprint, |
| 17 | + DecoratorApi, AsgiFunctionApp, SettingsApi, WsgiFunctionApp, |
| 18 | + HttpFunctionsAuthLevelMixin, FunctionRegister, TriggerApi, |
| 19 | + ExternalHttpFunctionApp |
| 20 | +) |
18 | 21 | from azure.functions.decorators.http import HttpTrigger, HttpOutput, \
|
19 | 22 | HttpMethod
|
20 | 23 | from azure.functions.decorators.retry_policy import RetryPolicy
|
@@ -322,6 +325,15 @@ def test_add_wsgi(self, add_http_app_mock):
|
322 | 325 | self.assertIsInstance(add_http_app_mock.call_args[0][0],
|
323 | 326 | WsgiMiddleware)
|
324 | 327 |
|
| 328 | + def test_extends_required_classes(self): |
| 329 | + self.assertTrue(issubclass(ExternalHttpFunctionApp, FunctionRegister)) |
| 330 | + self.assertTrue(issubclass(ExternalHttpFunctionApp, TriggerApi)) |
| 331 | + self.assertTrue(issubclass(ExternalHttpFunctionApp, SettingsApi)) |
| 332 | + self.assertTrue(issubclass(ExternalHttpFunctionApp, BindingApi)) |
| 333 | + self.assertTrue(issubclass(ExternalHttpFunctionApp, ABC)) |
| 334 | + self.assertTrue(issubclass(AsgiFunctionApp, ExternalHttpFunctionApp)) |
| 335 | + self.assertTrue(issubclass(WsgiFunctionApp, ExternalHttpFunctionApp)) |
| 336 | + |
325 | 337 | def test_add_asgi_app(self):
|
326 | 338 | self._test_http_external_app(AsgiFunctionApp(app=object()), True)
|
327 | 339 |
|
|
0 commit comments