#NEWLINE# def test_headers( self ) : #NEWLINE# #INDENT# api = restplus . Api ( self . app ) #NEWLINE# @ api . route ( '/headers/' ) #NEWLINE# class TestHeaders ( restplus . Resource ) : #NEWLINE# #INDENT# @ api . doc ( 'headers' ) #NEWLINE# @ api . header ( 'X-Header-1' , default = 'xxx' ) #NEWLINE# @ api . header ( 'X-Header-2' , required = True ) #NEWLINE# def get( self ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# #UNINDENT# data = api . as_postman ( urlvars = True ) #NEWLINE# validate ( headers , schema ) #NEWLINE# request = data [ 'requests' ] [ 0 ] #NEWLINE# headers = dict ( ( r . split ( ':' ) for r in request [ 'headers' ] . splitlines ( ) ) ) #NEWLINE# self . assertEqual ( headers [ 'X-Header-1' ] , 'xxx' ) #NEWLINE# self . assertEqual ( headers [ 'X-Header-2' ] , '' )