def test_activate_after_future_statements():
 script = ['#!/usr/bin/env python', 'from __future__ import with_statement', 'from __future__ import print_function', 'print("Hello, world!")']
 assert (virtualenv.relative_script(script) == ['#!/usr/bin/env python', 'from __future__ import with_statement', 'from __future__ import print_function', '', "import os; activate_this=os.path.join(os.path.dirname(os.path.realpath(__file__)), 'activate_this.py'); exec(compile(open(activate_this).read(), activate_this, 'exec'), dict(__file__=activate_this)); del os, activate_this", '', 'print("Hello, world!")'])

def test_activate_after_future_statements ( ) : script = [ '#!/usr/bin/env python' , 'from __future__ import with_statement' , 'from __future__ import print_function' , 'print("Hello, world!")' ] assert ( virtualenv . relative_script ( script ) == [ '#!/usr/bin/env python' , 'from __future__ import with_statement' , 'from __future__ import print_function' , '' , "import os; activate_this=os.path.join(os.path.dirname(os.path.realpath(__file__)), 'activate_this.py'); exec(compile(open(activate_this).read(), activate_this, 'exec'), dict(__file__=activate_this)); del os, activate_this" , '' , 'print("Hello, world!")' ] )
should insert activation line after last future statement .