Skip to content

Commit 8357066

Browse files
peterstone2017YunchuWang
authored andcommitted
fix flakey8
1 parent 92278dc commit 8357066

File tree

4 files changed

+9
-66
lines changed

4 files changed

+9
-66
lines changed

tests/endtoend/blueprint_functions/functions_in_both_blueprint_functionapp/function_app.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import azure.functions as func
22

3-
from azure_functions_worker import logging
43
from blueprint import bp
54

65
app = func.FunctionApp()
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
import azure.functions as func
22

33
app = func.FunctionApp()
4+
5+
46
@app.route(route="return_http")
57
def return_http(req: func.HttpRequest):
68
return func.HttpResponse('<h1>Hello World™</h1>',
79
mimetype='text/html')
810

9-
asgi_app = func.AsgiFunctionApp()
11+
12+
asgi_app = func.AsgiFunctionApp()
Lines changed: 4 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
# Copyright (c) Microsoft Corporation. All rights reserved.
22
# Licensed under the MIT License.
3-
import os
4-
from unittest.mock import patch
5-
6-
import requests
73

84
from azure_functions_worker import testutils
95

@@ -12,7 +8,7 @@ class TestFunctionInBluePrintOnly(testutils.WebHostTestCase):
128
@classmethod
139
def get_script_dir(cls):
1410
return testutils.E2E_TESTS_FOLDER / 'blueprint_functions' / \
15-
'functions_in_blueprint_only'
11+
'functions_in_blueprint_only'
1612

1713
@testutils.retryable_test(3, 5)
1814
def test_function_in_blueprint_only(self):
@@ -24,7 +20,7 @@ class TestFunctionsInBothBlueprintAndFuncApp(testutils.WebHostTestCase):
2420
@classmethod
2521
def get_script_dir(cls):
2622
return testutils.E2E_TESTS_FOLDER / 'blueprint_functions' / \
27-
'functions_in_both_blueprint_functionapp'
23+
'functions_in_both_blueprint_functionapp'
2824

2925
@testutils.retryable_test(3, 5)
3026
def test_functions_in_both_blueprint_functionapp(self):
@@ -39,7 +35,7 @@ class TestMultipleFunctionRegisters(testutils.WebHostTestCase):
3935
@classmethod
4036
def get_script_dir(cls):
4137
return testutils.E2E_TESTS_FOLDER / 'blueprint_functions' / \
42-
'multiple_function_registers'
38+
'multiple_function_registers'
4339

4440
@testutils.retryable_test(3, 5)
4541
def test_function_in_blueprint_only(self):
@@ -51,7 +47,7 @@ class TestOnlyBlueprint(testutils.WebHostTestCase):
5147
@classmethod
5248
def get_script_dir(cls):
5349
return testutils.E2E_TESTS_FOLDER / 'blueprint_functions' / \
54-
'only_blueprint'
50+
'only_blueprint'
5551

5652
@testutils.retryable_test(3, 5)
5753
def test_only_blueprint(self):
@@ -61,58 +57,3 @@ def test_only_blueprint(self):
6157
"""
6258
r = self.webhost.request('GET', 'default_template')
6359
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)

tests/endtoend/third_party_http_functions/stein/wsgi_function/function_app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@ def raise_http_exception():
3333

3434

3535
app = func.WsgiFunctionApp(app=flask_app.wsgi_app,
36-
http_auth_level=func.AuthLevel.ANONYMOUS)
36+
http_auth_level=func.AuthLevel.ANONYMOUS)

0 commit comments

Comments
 (0)