File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change
1
+ # Copyright (c) Microsoft Corporation. All rights reserved.
2
+ # Licensed under the MIT License.
3
+
4
+ import pytest
5
+
6
+ import azure_functions_worker .loader as loader
7
+ from azure .functions import Function
8
+ from azure .functions .decorators .core import InputBinding
9
+
10
+
11
+ def dummy_func ():
12
+ ...
13
+
14
+
15
+ class FakeInputBinding (InputBinding ):
16
+
17
+ def __init__ (self ,
18
+ name ):
19
+ super ().__init__ (name = name , data_type = None )
20
+
21
+ @staticmethod
22
+ def get_binding_name () -> str :
23
+ return "test_binding"
24
+
25
+
26
+ @pytest .mark .parametrize ("size" , range (10 ))
27
+ def test_build_binding_protos (benchmark , size ):
28
+ f = Function (dummy_func , "foo.py" )
29
+ for i in range (size ):
30
+ f .add_binding (FakeInputBinding (f"test_binding{ i } " ))
31
+ r = benchmark (loader .build_binding_protos , f )
You can’t perform that action at this time.
0 commit comments