@@ -61,7 +61,7 @@ def mock_operation_parser(self):
61
61
return mock_parser
62
62
63
63
@pytest .fixture
64
- def sample_endpiont (self ):
64
+ def sample_endpoint (self ):
65
65
return OperationEndpoint (
66
66
base_url = "https://example.com" , path = "/test" , method = "GET"
67
67
)
@@ -131,38 +131,38 @@ def sample_auth_credential(self):
131
131
132
132
def test_init (
133
133
self ,
134
- sample_endpiont ,
134
+ sample_endpoint ,
135
135
sample_operation ,
136
136
sample_auth_scheme ,
137
137
sample_auth_credential ,
138
138
):
139
139
tool = RestApiTool (
140
140
name = "test_tool" ,
141
141
description = "Test Tool" ,
142
- endpoint = sample_endpiont ,
142
+ endpoint = sample_endpoint ,
143
143
operation = sample_operation ,
144
144
auth_scheme = sample_auth_scheme ,
145
145
auth_credential = sample_auth_credential ,
146
146
)
147
147
assert tool .name == "test_tool"
148
148
assert tool .description == "Test Tool"
149
- assert tool .endpoint == sample_endpiont
149
+ assert tool .endpoint == sample_endpoint
150
150
assert tool .operation == sample_operation
151
151
assert tool .auth_credential == sample_auth_credential
152
152
assert tool .auth_scheme == sample_auth_scheme
153
153
assert tool .credential_exchanger is not None
154
154
155
155
def test_from_parsed_operation_str (
156
156
self ,
157
- sample_endpiont ,
157
+ sample_endpoint ,
158
158
sample_api_parameters ,
159
159
sample_return_parameter ,
160
160
sample_operation ,
161
161
):
162
162
parsed_operation_str = json .dumps ({
163
163
"name" : "test_operation" ,
164
164
"description" : "Test Description" ,
165
- "endpoint" : sample_endpiont .model_dump (),
165
+ "endpoint" : sample_endpoint .model_dump (),
166
166
"operation" : sample_operation .model_dump (),
167
167
"auth_scheme" : None ,
168
168
"auth_credential" : None ,
@@ -174,12 +174,12 @@ def test_from_parsed_operation_str(
174
174
assert tool .name == "test_operation"
175
175
176
176
def test_get_declaration (
177
- self , sample_endpiont , sample_operation , mock_operation_parser
177
+ self , sample_endpoint , sample_operation , mock_operation_parser
178
178
):
179
179
tool = RestApiTool (
180
180
name = "test_tool" ,
181
181
description = "Test description" ,
182
- endpoint = sample_endpiont ,
182
+ endpoint = sample_endpoint ,
183
183
operation = sample_operation ,
184
184
should_parse_operation = False ,
185
185
)
@@ -198,7 +198,7 @@ def test_call_success(
198
198
self ,
199
199
mock_request ,
200
200
mock_tool_context ,
201
- sample_endpiont ,
201
+ sample_endpoint ,
202
202
sample_operation ,
203
203
sample_auth_scheme ,
204
204
sample_auth_credential ,
@@ -210,7 +210,7 @@ def test_call_success(
210
210
tool = RestApiTool (
211
211
name = "test_tool" ,
212
212
description = "Test Tool" ,
213
- endpoint = sample_endpiont ,
213
+ endpoint = sample_endpoint ,
214
214
operation = sample_operation ,
215
215
auth_scheme = sample_auth_scheme ,
216
216
auth_credential = sample_auth_credential ,
@@ -228,7 +228,7 @@ def test_call_success(
228
228
def test_call_auth_pending (
229
229
self ,
230
230
mock_request ,
231
- sample_endpiont ,
231
+ sample_endpoint ,
232
232
sample_operation ,
233
233
sample_auth_scheme ,
234
234
sample_auth_credential ,
@@ -237,7 +237,7 @@ def test_call_auth_pending(
237
237
tool = RestApiTool (
238
238
name = "test_tool" ,
239
239
description = "Test Tool" ,
240
- endpoint = sample_endpiont ,
240
+ endpoint = sample_endpoint ,
241
241
operation = sample_operation ,
242
242
auth_scheme = sample_auth_scheme ,
243
243
auth_credential = sample_auth_credential ,
@@ -258,7 +258,7 @@ def test_call_auth_pending(
258
258
}
259
259
260
260
def test_prepare_request_params_query_body (
261
- self , sample_endpiont , sample_auth_credential , sample_auth_scheme
261
+ self , sample_endpoint , sample_auth_credential , sample_auth_scheme
262
262
):
263
263
# Create a mock Operation object
264
264
mock_operation = Operation (
@@ -288,7 +288,7 @@ def test_prepare_request_params_query_body(
288
288
tool = RestApiTool (
289
289
name = "test_tool" ,
290
290
description = "test" ,
291
- endpoint = sample_endpiont ,
291
+ endpoint = sample_endpoint ,
292
292
operation = mock_operation ,
293
293
auth_credential = sample_auth_credential ,
294
294
auth_scheme = sample_auth_scheme ,
@@ -327,7 +327,7 @@ def test_prepare_request_params_query_body(
327
327
assert request_params ["params" ] == {"testQueryParam" : "query_value" }
328
328
329
329
def test_prepare_request_params_array (
330
- self , sample_endpiont , sample_auth_scheme , sample_auth_credential
330
+ self , sample_endpoint , sample_auth_scheme , sample_auth_credential
331
331
):
332
332
mock_operation = Operation (
333
333
operationId = "test_op" ,
@@ -345,7 +345,7 @@ def test_prepare_request_params_array(
345
345
tool = RestApiTool (
346
346
name = "test_tool" ,
347
347
description = "test" ,
348
- endpoint = sample_endpiont ,
348
+ endpoint = sample_endpoint ,
349
349
operation = mock_operation ,
350
350
auth_credential = sample_auth_credential ,
351
351
auth_scheme = sample_auth_scheme ,
@@ -367,7 +367,7 @@ def test_prepare_request_params_array(
367
367
assert request_params ["json" ] == ["item1" , "item2" ]
368
368
369
369
def test_prepare_request_params_string (
370
- self , sample_endpiont , sample_auth_credential , sample_auth_scheme
370
+ self , sample_endpoint , sample_auth_credential , sample_auth_scheme
371
371
):
372
372
mock_operation = Operation (
373
373
operationId = "test_op" ,
@@ -380,7 +380,7 @@ def test_prepare_request_params_string(
380
380
tool = RestApiTool (
381
381
name = "test_tool" ,
382
382
description = "Test Tool" ,
383
- endpoint = sample_endpiont ,
383
+ endpoint = sample_endpoint ,
384
384
operation = mock_operation ,
385
385
auth_credential = sample_auth_credential ,
386
386
auth_scheme = sample_auth_scheme ,
@@ -401,7 +401,7 @@ def test_prepare_request_params_string(
401
401
assert request_params ["headers" ]["Content-Type" ] == "text/plain"
402
402
403
403
def test_prepare_request_params_form_data (
404
- self , sample_endpiont , sample_auth_scheme , sample_auth_credential
404
+ self , sample_endpoint , sample_auth_scheme , sample_auth_credential
405
405
):
406
406
mock_operation = Operation (
407
407
operationId = "test_op" ,
@@ -419,7 +419,7 @@ def test_prepare_request_params_form_data(
419
419
tool = RestApiTool (
420
420
name = "test_tool" ,
421
421
description = "test" ,
422
- endpoint = sample_endpiont ,
422
+ endpoint = sample_endpoint ,
423
423
operation = mock_operation ,
424
424
auth_credential = sample_auth_credential ,
425
425
auth_scheme = sample_auth_scheme ,
@@ -443,7 +443,7 @@ def test_prepare_request_params_form_data(
443
443
)
444
444
445
445
def test_prepare_request_params_multipart (
446
- self , sample_endpiont , sample_auth_credential , sample_auth_scheme
446
+ self , sample_endpoint , sample_auth_credential , sample_auth_scheme
447
447
):
448
448
mock_operation = Operation (
449
449
operationId = "test_op" ,
@@ -465,7 +465,7 @@ def test_prepare_request_params_multipart(
465
465
tool = RestApiTool (
466
466
name = "test_tool" ,
467
467
description = "test" ,
468
- endpoint = sample_endpiont ,
468
+ endpoint = sample_endpoint ,
469
469
operation = mock_operation ,
470
470
auth_credential = sample_auth_credential ,
471
471
auth_scheme = sample_auth_scheme ,
@@ -486,7 +486,7 @@ def test_prepare_request_params_multipart(
486
486
assert request_params ["headers" ]["Content-Type" ] == "multipart/form-data"
487
487
488
488
def test_prepare_request_params_octet_stream (
489
- self , sample_endpiont , sample_auth_scheme , sample_auth_credential
489
+ self , sample_endpoint , sample_auth_scheme , sample_auth_credential
490
490
):
491
491
mock_operation = Operation (
492
492
operationId = "test_op" ,
@@ -501,7 +501,7 @@ def test_prepare_request_params_octet_stream(
501
501
tool = RestApiTool (
502
502
name = "test_tool" ,
503
503
description = "test" ,
504
- endpoint = sample_endpiont ,
504
+ endpoint = sample_endpoint ,
505
505
operation = mock_operation ,
506
506
auth_credential = sample_auth_credential ,
507
507
auth_scheme = sample_auth_scheme ,
@@ -524,13 +524,13 @@ def test_prepare_request_params_octet_stream(
524
524
)
525
525
526
526
def test_prepare_request_params_path_param (
527
- self , sample_endpiont , sample_auth_credential , sample_auth_scheme
527
+ self , sample_endpoint , sample_auth_credential , sample_auth_scheme
528
528
):
529
529
mock_operation = Operation (operationId = "test_op" )
530
530
tool = RestApiTool (
531
531
name = "test_tool" ,
532
532
description = "Test Tool" ,
533
- endpoint = sample_endpiont ,
533
+ endpoint = sample_endpoint ,
534
534
operation = mock_operation ,
535
535
auth_credential = sample_auth_credential ,
536
536
auth_scheme = sample_auth_scheme ,
@@ -557,15 +557,15 @@ def test_prepare_request_params_path_param(
557
557
558
558
def test_prepare_request_params_header_param (
559
559
self ,
560
- sample_endpiont ,
560
+ sample_endpoint ,
561
561
sample_auth_credential ,
562
562
sample_auth_scheme ,
563
563
sample_operation ,
564
564
):
565
565
tool = RestApiTool (
566
566
name = "test_tool" ,
567
567
description = "Test Tool" ,
568
- endpoint = sample_endpiont ,
568
+ endpoint = sample_endpoint ,
569
569
operation = sample_operation ,
570
570
auth_credential = sample_auth_credential ,
571
571
auth_scheme = sample_auth_scheme ,
@@ -586,15 +586,15 @@ def test_prepare_request_params_header_param(
586
586
587
587
def test_prepare_request_params_cookie_param (
588
588
self ,
589
- sample_endpiont ,
589
+ sample_endpoint ,
590
590
sample_auth_credential ,
591
591
sample_auth_scheme ,
592
592
sample_operation ,
593
593
):
594
594
tool = RestApiTool (
595
595
name = "test_tool" ,
596
596
description = "Test Tool" ,
597
- endpoint = sample_endpiont ,
597
+ endpoint = sample_endpoint ,
598
598
operation = sample_operation ,
599
599
auth_credential = sample_auth_credential ,
600
600
auth_scheme = sample_auth_scheme ,
@@ -614,7 +614,7 @@ def test_prepare_request_params_cookie_param(
614
614
assert request_params ["cookies" ]["session_id" ] == "cookie_value"
615
615
616
616
def test_prepare_request_params_multiple_mime_types (
617
- self , sample_endpiont , sample_auth_credential , sample_auth_scheme
617
+ self , sample_endpoint , sample_auth_credential , sample_auth_scheme
618
618
):
619
619
# Test what happens when multiple mime types are specified. It should take
620
620
# the first one.
@@ -632,7 +632,7 @@ def test_prepare_request_params_multiple_mime_types(
632
632
tool = RestApiTool (
633
633
name = "test_tool" ,
634
634
description = "Test Tool" ,
635
- endpoint = sample_endpiont ,
635
+ endpoint = sample_endpoint ,
636
636
operation = mock_operation ,
637
637
auth_credential = sample_auth_credential ,
638
638
auth_scheme = sample_auth_scheme ,
@@ -653,15 +653,15 @@ def test_prepare_request_params_multiple_mime_types(
653
653
654
654
def test_prepare_request_params_unknown_parameter (
655
655
self ,
656
- sample_endpiont ,
656
+ sample_endpoint ,
657
657
sample_auth_credential ,
658
658
sample_auth_scheme ,
659
659
sample_operation ,
660
660
):
661
661
tool = RestApiTool (
662
662
name = "test_tool" ,
663
663
description = "Test Tool" ,
664
- endpoint = sample_endpiont ,
664
+ endpoint = sample_endpoint ,
665
665
operation = sample_operation ,
666
666
auth_credential = sample_auth_credential ,
667
667
auth_scheme = sample_auth_scheme ,
@@ -719,15 +719,15 @@ def test_prepare_request_params_base_url_handling(
719
719
720
720
def test_prepare_request_params_no_unrecognized_query_parameter (
721
721
self ,
722
- sample_endpiont ,
722
+ sample_endpoint ,
723
723
sample_auth_credential ,
724
724
sample_auth_scheme ,
725
725
sample_operation ,
726
726
):
727
727
tool = RestApiTool (
728
728
name = "test_tool" ,
729
729
description = "Test Tool" ,
730
- endpoint = sample_endpiont ,
730
+ endpoint = sample_endpoint ,
731
731
operation = sample_operation ,
732
732
auth_credential = sample_auth_credential ,
733
733
auth_scheme = sample_auth_scheme ,
@@ -748,13 +748,13 @@ def test_prepare_request_params_no_unrecognized_query_parameter(
748
748
749
749
def test_prepare_request_params_no_credential (
750
750
self ,
751
- sample_endpiont ,
751
+ sample_endpoint ,
752
752
sample_operation ,
753
753
):
754
754
tool = RestApiTool (
755
755
name = "test_tool" ,
756
756
description = "Test Tool" ,
757
- endpoint = sample_endpiont ,
757
+ endpoint = sample_endpoint ,
758
758
operation = sample_operation ,
759
759
auth_credential = None ,
760
760
auth_scheme = None ,
0 commit comments