File tree Expand file tree Collapse file tree 2 files changed +40
-7
lines changed Expand file tree Collapse file tree 2 files changed +40
-7
lines changed Original file line number Diff line number Diff line change @@ -287,17 +287,16 @@ components:
287
287
type : integer
288
288
format : int64
289
289
PetCreate :
290
- type : object
291
- x-model : PetCreate
290
+ # type: object
292
291
allOf :
293
292
- $ref : " #/components/schemas/PetCreatePartOne"
294
- - $ref : " #/components/schemas/PetCreatePartTwo"
295
- oneOf :
296
- - $ref : " #/components/schemas/Cat"
297
- - $ref : " #/components/schemas/Bird"
293
+ - type : object
294
+ properties :
295
+ birth_date :
296
+ type : string
297
+ format : date
298
298
PetCreatePartOne :
299
299
type : object
300
- x-model : PetCreatePartOne
301
300
required :
302
301
- name
303
302
properties :
Original file line number Diff line number Diff line change 1
1
import json
2
2
from base64 import b64encode
3
+ from datetime import date
3
4
from datetime import datetime
4
5
from uuid import UUID
5
6
@@ -550,6 +551,39 @@ def test_get_pets_param_coordinates(self, spec):
550
551
551
552
assert body is None
552
553
554
+ def test_birth_date (self , spec ):
555
+ host_url = "https://staging.gigantic-server.com/v1"
556
+ path_pattern = "/v1/pets"
557
+ headers = {
558
+ "api-key" : self .api_key_encoded ,
559
+ }
560
+ cookies = {
561
+ "user" : "123" ,
562
+ "userdata" : {
563
+ "name" : "user1" ,
564
+ },
565
+ }
566
+
567
+ data_json = {
568
+ "name" : "required" ,
569
+ "birth_date" : "2022-09-18"
570
+ }
571
+ data = json .dumps (data_json )
572
+
573
+ request = MockRequest (
574
+ host_url ,
575
+ "POST" ,
576
+ "/pets" ,
577
+ path_pattern = path_pattern ,
578
+ data = data ,
579
+ headers = headers ,
580
+ cookies = cookies ,
581
+ )
582
+
583
+ body = spec_validate_body (spec , request )
584
+
585
+ assert isinstance (body ["birth_date" ], date )
586
+
553
587
def test_post_birds (self , spec , spec_dict ):
554
588
host_url = "https://staging.gigantic-server.com/v1"
555
589
path_pattern = "/v1/pets"
You can’t perform that action at this time.
0 commit comments