#NEWLINE# def test( self ) : #NEWLINE# #INDENT# port = self . get_http_port ( ) #NEWLINE# print ( 'Server port is {}' . format ( port ) ) #NEWLINE# print ( 'Starting phantomjs' ) #NEWLINE# p = subprocess . Popen ( 'phantomjs {}/phantomjs_test.js http://localhost:{}' . format ( here , port ) , shell = True , stdin = None ) #NEWLINE# status = None #NEWLINE# for x in range ( TEST_TIMEOUT ) : #NEWLINE# #INDENT# status = p . poll ( ) #NEWLINE# if ( status is not None ) : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# time . sleep ( 1 ) #NEWLINE# #UNINDENT# if ( status is None ) : #NEWLINE# #INDENT# raise AssertionError ( 'PhantomJS failed to complete' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# print ( 'PhantomJS return status is {}' . format ( status ) ) #NEWLINE# assert ( status == 0 )