#NEWLINE# def test_basic_request( ) : #NEWLINE# #INDENT# env = dict ( copy . deepcopy ( env1 ) ) #NEWLINE# req = Request ( env ) #NEWLINE# assert ( 'cocopot.request' in env ) #NEWLINE# assert ( req . args == MultiDict ( { #NEWLINE# #INDENT# 'a' : '1' , #NEWLINE# 'b' : '2' , #NEWLINE# #UNINDENT# } . items ( ) ) ) #NEWLINE# assert ( req . values == MultiDict ( { #NEWLINE# #INDENT# 'a' : '1' , #NEWLINE# 'b' : '2' , #NEWLINE# #UNINDENT# } . items ( ) ) ) #NEWLINE# assert ( req . path == '/bar' ) #NEWLINE# assert ( req . full_path == '/foo/bar' ) #NEWLINE# assert ( req . script_root == '/foo' ) #NEWLINE# assert ( req . url == 'http://test.cocopot.org/foo/bar?a=1&b=2' ) #NEWLINE# assert ( req . base_url == 'http://test.cocopot.org/foo/bar' ) #NEWLINE# assert ( req . root_url == 'http://test.cocopot.org/foo/' ) #NEWLINE# assert ( req . host_url == 'http://test.cocopot.org/' ) #NEWLINE# assert ( req . host == 'test.cocopot.org' ) #NEWLINE# assert ( req . get_data ( ) == b'' ) #NEWLINE# assert ( req . get_data ( as_text = True ) == '' ) #NEWLINE# assert ( req . blueprint == None ) #NEWLINE# assert ( req . mimetype == 'text/plain' ) #NEWLINE# assert ( req . mimetype_params == { #NEWLINE# #INDENT# 'charset' : 'utf-8' , #NEWLINE# #UNINDENT# } ) #NEWLINE# assert ( req . get_json ( ) == None ) #NEWLINE# assert ( req . get_json ( ) == None ) #NEWLINE# assert ( req . content_length == 0 ) #NEWLINE# assert ( req . authorization == None ) #NEWLINE# assert ( req . cookies == FormsDict ( ) ) #NEWLINE# assert ( list ( req . range ) == [ ] ) #NEWLINE# assert ( req . access_route == [ ] ) #NEWLINE# assert ( req . is_xhr == False ) #NEWLINE# assert ( req . is_secure == False ) #NEWLINE# assert ( req . if_modified_since == None ) #NEWLINE# assert ( req . if_unmodified_since == None ) #NEWLINE# assert ( req . access_route == [ ] ) #NEWLINE# assert ( req . remote_addr == None ) #NEWLINE# assert ( req . chunked == False ) #NEWLINE# assert ( req . method == 'POST' ) #NEWLINE# assert ( req . url_charset == 'utf-8' ) #NEWLINE# assert ( 'Content-Length' in req . headers ) #NEWLINE# assert ( 'Request' in repr ( req ) )