@@ -468,7 +468,11 @@ def test_upload_file(self):
468
468
name = 'file' ,
469
469
data = file_bytes ,
470
470
filename = file_name ,
471
- headers = {'Content-Type' : 'application/octet-stream' }
471
+ headers = {
472
+ 'Content-Location' : None ,
473
+ 'Content-Type' : 'image/png' ,
474
+ "Content-Disposition" : "form-data; name=\" file\" ; filename=\" 1px_pic1.png\" "
475
+ }
472
476
),
473
477
),
474
478
content_type = 'multipart/form-data'
@@ -492,7 +496,11 @@ def test_upload_file(self):
492
496
api_client .RequestField (
493
497
name = 'file' ,
494
498
data = file_bytes ,
495
- headers = {'Content-Type' : 'application/octet-stream' }
499
+ headers = {
500
+ 'Content-Type' : 'application/octet-stream' ,
501
+ "Content-Disposition" : "form-data; name=\" file\" " ,
502
+ "Content-Location" : None
503
+ }
496
504
),
497
505
),
498
506
content_type = 'multipart/form-data'
@@ -547,13 +555,22 @@ def test_upload_files(self):
547
555
name = 'files' ,
548
556
data = file_bytes ,
549
557
filename = file_name ,
550
- headers = {'Content-Type' : 'application/octet-stream' }
558
+ headers = {
559
+ 'Content-Type' : 'image/png' ,
560
+ "Content-Disposition" : "form-data; name=\" files\" ; filename=\" 1px_pic1.png\" " ,
561
+ "Content-Location" : None
562
+ }
551
563
),
552
564
api_client .RequestField (
553
565
name = 'files' ,
554
566
data = file_bytes ,
555
567
filename = file_name ,
556
- headers = {'Content-Type' : 'application/octet-stream' }
568
+ headers = {
569
+ 'Content-Type' : 'image/png' ,
570
+ "Content-Disposition" : "form-data; name=\" files\" ; filename=\" 1px_pic1.png\" " ,
571
+ "Content-Location" : None
572
+
573
+ }
557
574
),
558
575
),
559
576
content_type = 'multipart/form-data'
@@ -578,12 +595,20 @@ def test_upload_files(self):
578
595
api_client .RequestField (
579
596
name = 'files' ,
580
597
data = file_bytes ,
581
- headers = {'Content-Type' : 'application/octet-stream' }
598
+ headers = {
599
+ 'Content-Type' : 'application/octet-stream' ,
600
+ "Content-Disposition" : "form-data; name=\" files\" " ,
601
+ "Content-Location" : None
602
+ }
582
603
),
583
604
api_client .RequestField (
584
605
name = 'files' ,
585
606
data = file_bytes ,
586
- headers = {'Content-Type' : 'application/octet-stream' }
607
+ headers = {
608
+ 'Content-Type' : 'application/octet-stream' ,
609
+ "Content-Disposition" : "form-data; name=\" files\" " ,
610
+ "Content-Location" : None
611
+ }
587
612
),
588
613
),
589
614
content_type = 'multipart/form-data'
@@ -650,17 +675,22 @@ def test_inline_composition(self, mock_request):
650
675
content_type = content_type ,
651
676
accept_content_types = (content_type ,)
652
677
)
678
+ self .maxDiff = None
653
679
self .assert_request_called_with (
654
680
mock_request ,
655
681
'http://petstore.swagger.io:80/v2/fake/inlineComposition/?compositionAtRoot=a&someProp=a' ,
656
682
accept_content_type = content_type ,
657
683
content_type = content_type ,
658
684
fields = (
659
- api_client .RequestField (
660
- name = 'someProp' ,
661
- data = single_char_str ,
662
- headers = {'Content-Type' : 'text/plain' }
663
- ),
685
+ api_client .RequestField (
686
+ name = 'someProp' ,
687
+ data = single_char_str ,
688
+ headers = {
689
+ 'Content-Type' : 'text/plain' ,
690
+ "Content-Disposition" : "form-data; name=\" someProp\" " ,
691
+ "Content-Location" : None
692
+ }
693
+ ),
664
694
),
665
695
)
666
696
self .assertEqual (api_response .body , {'someProp' : single_char_str })
0 commit comments