#NEWLINE# def test_response_cookies( ) : #NEWLINE# #INDENT# header_lines = [ 'HTTP/1.1 200 OK' , 'Content-Length: 0' , 'Set-Cookie: ck=1234=567;Expires=Wed, 09 Jun 2021 10:18:14 GMT;secure;httponly;path=/;max-age=12;domain=.foo.bar' , 'Set-Cookie: abc=123' , 'Set-Cookie: def=456' , '' ] #NEWLINE# ( rf , rl , ru , rj ) = rsp_by_lines_and_full ( header_lines ) #NEWLINE# def test( r ) : #NEWLINE# #INDENT# assert r . complete #NEWLINE# assert ( r . cookies [ 'ck' ] . key == 'ck' ) #NEWLINE# assert ( r . cookies [ 'ck' ] . val == '1234=567' ) #NEWLINE# assert ( r . cookies [ 'ck' ] . domain == '.foo.bar' ) #NEWLINE# assert ( r . cookies [ 'ck' ] . expires == 'Wed, 09 Jun 2021 10:18:14 GMT' ) #NEWLINE# assert r . cookies [ 'ck' ] . http_only #NEWLINE# assert ( r . cookies [ 'ck' ] . max_age == 12 ) #NEWLINE# assert ( r . cookies [ 'ck' ] . path == '/' ) #NEWLINE# assert r . cookies [ 'ck' ] . secure #NEWLINE# assert ( r . cookies [ 'abc' ] . val == '123' ) #NEWLINE# assert ( r . cookies [ 'def' ] . val == '456' ) #NEWLINE# #UNINDENT# test ( rf ) #NEWLINE# test ( rl ) #NEWLINE# test ( ru ) #NEWLINE# test ( rj )