@@ -56,7 +56,9 @@ def test_get_dict_repr_sdk(self):
56
56
# Create test indexed_function
57
57
mock_indexed_functions = MockFunction (bindings = [mock_blob ])
58
58
59
- dict_repr = utils .get_raw_bindings (mock_indexed_functions , mock_input_types )
59
+ dict_repr , logs = utils .get_raw_bindings (
60
+ mock_indexed_functions , mock_input_types
61
+ )
60
62
self .assertEqual (
61
63
dict_repr ,
62
64
[
@@ -67,6 +69,8 @@ def test_get_dict_repr_sdk(self):
67
69
],
68
70
)
69
71
72
+ self .assertEqual (logs , {"client" : {sdkType .SdkType : "True" }})
73
+
70
74
def test_get_dict_repr_non_sdk (self ):
71
75
# Create mock blob
72
76
meta ._ConverterMeta ._bindings = {"blob" }
@@ -87,7 +91,9 @@ def test_get_dict_repr_non_sdk(self):
87
91
# Create test indexed_function
88
92
mock_indexed_functions = MockFunction (bindings = [mock_blob ])
89
93
90
- dict_repr = utils .get_raw_bindings (mock_indexed_functions , mock_input_types )
94
+ dict_repr , logs = utils .get_raw_bindings (
95
+ mock_indexed_functions , mock_input_types
96
+ )
91
97
self .assertEqual (
92
98
dict_repr ,
93
99
[
@@ -97,6 +103,48 @@ def test_get_dict_repr_non_sdk(self):
97
103
'{"SupportsDeferredBinding": false}}'
98
104
],
99
105
)
106
+ self .assertEqual (logs , {"blob" : {bytes : "False" }})
107
+
108
+ def test_get_dict_repr_binding_name_none (self ):
109
+ # Create mock blob
110
+ meta ._ConverterMeta ._bindings = {"blob" }
111
+
112
+ # Create test binding
113
+ mock_blob = utils .Binding (
114
+ name = "blob" ,
115
+ direction = utils .BindingDirection .IN ,
116
+ data_type = None ,
117
+ type = "blob" ,
118
+ )
119
+
120
+ mock_http = utils .Binding (
121
+ name = "$return" ,
122
+ direction = utils .BindingDirection .OUT ,
123
+ data_type = None ,
124
+ type = "httpResponse" ,
125
+ )
126
+
127
+ # Create test input_types dict
128
+ mock_input_types = {
129
+ "blob" : MockParamTypeInfo (binding_name = "blobTrigger" , pytype = bytes )
130
+ }
131
+
132
+ # Create test indexed_function
133
+ mock_indexed_functions = MockFunction (bindings = [mock_blob , mock_http ])
134
+
135
+ dict_repr , logs = utils .get_raw_bindings (
136
+ mock_indexed_functions , mock_input_types
137
+ )
138
+ self .assertEqual (
139
+ dict_repr ,
140
+ [
141
+ '{"direction": "IN", "dataType": null, "type": "blob", '
142
+ '"properties": {"SupportsDeferredBinding": false}}' ,
143
+ '{"direction": "OUT", "dataType": null, "type": "httpResponse", '
144
+ '"properties": {"SupportsDeferredBinding": false}}' ,
145
+ ],
146
+ )
147
+ self .assertEqual (logs , {"$return" : {None : "False" }, "blob" : {bytes : "False" }})
100
148
101
149
def test_get_dict_repr_init_params (self ):
102
150
# Create mock blob
@@ -121,7 +169,9 @@ def test_get_dict_repr_init_params(self):
121
169
# Create test indexed_function
122
170
mock_indexed_functions = MockFunction (bindings = [mock_blob ])
123
171
124
- dict_repr = utils .get_raw_bindings (mock_indexed_functions , mock_input_types )
172
+ dict_repr , logs = utils .get_raw_bindings (
173
+ mock_indexed_functions , mock_input_types
174
+ )
125
175
self .assertEqual (
126
176
dict_repr ,
127
177
[
@@ -131,6 +181,8 @@ def test_get_dict_repr_init_params(self):
131
181
],
132
182
)
133
183
184
+ self .assertEqual (logs , {"client" : {sdkType .SdkType : "True" }})
185
+
134
186
def test_binding_data_type (self ):
135
187
mock_blob = utils .Binding (
136
188
name = "blob" ,
0 commit comments