<s> import temporary_daemon <EOL> import async_http_connection <EOL> def AsyncHTTPConnectionTest ( self ) : <EOL> def setUp ( self ) : <EOL> self . daemon = temporary_daemon . TemporaryDaemon ( ) <EOL> def test_basic ( self ) : <EOL> async_http_connection . AsyncHTTPConnection ( daemon . host , daemon . port ) <EOL> async_http_connection . begin_request ( '<STR_LIT:GET>' , '<STR_LIT:/>' ) <EOL> while not async_http_connection . is_response_ready ( ) : <EOL> time . sleep ( <NUM_LIT:0.1> ) <EOL> print '<STR_LIT>' <EOL> res = async_http_connection . get_response ( ) <EOL> print res . status <EOL> print res . read ( ) <EOL> def tearDown ( self ) : <EOL> self . daemon . close ( ) </s>
