1
1
# Copyright (c) Microsoft Corporation. All rights reserved.
2
2
# Licensed under the MIT License.
3
- import os
4
- from unittest .mock import patch
5
-
6
- import requests
7
3
8
4
from azure_functions_worker import testutils
9
5
@@ -12,7 +8,7 @@ class TestFunctionInBluePrintOnly(testutils.WebHostTestCase):
12
8
@classmethod
13
9
def get_script_dir (cls ):
14
10
return testutils .E2E_TESTS_FOLDER / 'blueprint_functions' / \
15
- 'functions_in_blueprint_only'
11
+ 'functions_in_blueprint_only'
16
12
17
13
@testutils .retryable_test (3 , 5 )
18
14
def test_function_in_blueprint_only (self ):
@@ -24,7 +20,7 @@ class TestFunctionsInBothBlueprintAndFuncApp(testutils.WebHostTestCase):
24
20
@classmethod
25
21
def get_script_dir (cls ):
26
22
return testutils .E2E_TESTS_FOLDER / 'blueprint_functions' / \
27
- 'functions_in_both_blueprint_functionapp'
23
+ 'functions_in_both_blueprint_functionapp'
28
24
29
25
@testutils .retryable_test (3 , 5 )
30
26
def test_functions_in_both_blueprint_functionapp (self ):
@@ -39,7 +35,7 @@ class TestMultipleFunctionRegisters(testutils.WebHostTestCase):
39
35
@classmethod
40
36
def get_script_dir (cls ):
41
37
return testutils .E2E_TESTS_FOLDER / 'blueprint_functions' / \
42
- 'multiple_function_registers'
38
+ 'multiple_function_registers'
43
39
44
40
@testutils .retryable_test (3 , 5 )
45
41
def test_function_in_blueprint_only (self ):
@@ -51,7 +47,7 @@ class TestOnlyBlueprint(testutils.WebHostTestCase):
51
47
@classmethod
52
48
def get_script_dir (cls ):
53
49
return testutils .E2E_TESTS_FOLDER / 'blueprint_functions' / \
54
- 'only_blueprint'
50
+ 'only_blueprint'
55
51
56
52
@testutils .retryable_test (3 , 5 )
57
53
def test_only_blueprint (self ):
@@ -61,58 +57,3 @@ def test_only_blueprint(self):
61
57
"""
62
58
r = self .webhost .request ('GET' , 'default_template' )
63
59
self .assertEqual (r .status_code , 404 )
64
- #
65
- # @testutils.retryable_test(3, 5)
66
- # def test_default_http_template_should_accept_query_param(self):
67
- # """Test if the azure.functions SDK is able to deserialize query
68
- # parameter from the default template
69
- # """
70
- # r = self.webhost.request('GET', 'default_template',
71
- # params={'name': 'query'},
72
- # timeout=REQUEST_TIMEOUT_SEC)
73
- # self.assertTrue(r.ok)
74
- # self.assertEqual(
75
- # r.content,
76
- # b'Hello, query. This HTTP triggered function executed successfully.'
77
- # )
78
- #
79
- # @testutils.retryable_test(3, 5)
80
- # def test_default_http_template_should_accept_body(self):
81
- # """Test if the azure.functions SDK is able to deserialize http body
82
- # and pass it to default template
83
- # """
84
- # r = self.webhost.request('POST', 'default_template',
85
- # data='{ "name": "body" }'.encode('utf-8'),
86
- # timeout=REQUEST_TIMEOUT_SEC)
87
- # self.assertTrue(r.ok)
88
- # self.assertEqual(
89
- # r.content,
90
- # b'Hello, body. This HTTP triggered function executed successfully.'
91
- # )
92
- #
93
- # @testutils.retryable_test(3, 5)
94
- # def test_worker_status_endpoint_should_return_ok(self):
95
- # """Test if the worker status endpoint will trigger
96
- # _handle__worker_status_request and sends a worker status response back
97
- # to host
98
- # """
99
- # root_url = self.webhost._addr
100
- # health_check_url = f'{root_url}/admin/host/ping'
101
- # r = requests.post(health_check_url,
102
- # params={'checkHealth': '1'},
103
- # timeout=REQUEST_TIMEOUT_SEC)
104
- # self.assertTrue(r.ok)
105
- #
106
- # @testutils.retryable_test(3, 5)
107
- # def test_worker_status_endpoint_should_return_ok_when_disabled(self):
108
- # """Test if the worker status endpoint will trigger
109
- # _handle__worker_status_request and sends a worker status response back
110
- # to host
111
- # """
112
- # os.environ['WEBSITE_PING_METRICS_SCALE_ENABLED'] = '0'
113
- # root_url = self.webhost._addr
114
- # health_check_url = f'{root_url}/admin/host/ping'
115
- # r = requests.post(health_check_url,
116
- # params={'checkHealth': '1'},
117
- # timeout=REQUEST_TIMEOUT_SEC)
118
- # self.assertTrue(r.ok)
0 commit comments