<s> from __future__ import ( absolute_import , division , generators , nested_scopes , print_function , <EOL> unicode_literals , with_statement ) <EOL> import os <EOL> from pants . util . contextutil import open_zip <EOL> from pants . util . dirutil import safe_delete <EOL> from pants_test . pants_run_integration_test import PantsRunIntegrationTest <EOL> class JvmPrepCommandIntegration ( PantsRunIntegrationTest ) : <EOL> def setUp ( self ) : <EOL> safe_delete ( '<STR_LIT>' ) <EOL> safe_delete ( '<STR_LIT>' ) <EOL> safe_delete ( '<STR_LIT>' ) <EOL> def assert_prep_compile ( self ) : <EOL> with open_zip ( '<STR_LIT>' ) as jar : <EOL> self . assertEquals ( sorted ( [ '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' ] ) , <EOL> sorted ( jar . namelist ( ) ) ) <EOL> def test_jvm_prep_command_in_compile ( self ) : <EOL> pants_run = self . run_pants ( [ <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' ] ) <EOL> self . assert_success ( pants_run ) <EOL> self . assertTrue ( os . path . exists ( '<STR_LIT>' ) ) <EOL> self . assertFalse ( os . path . exists ( '<STR_LIT>' ) ) <EOL> self . assertFalse ( os . path . exists ( '<STR_LIT>' ) ) <EOL> self . assert_prep_compile ( ) <EOL> def test_jvm_prep_command_in_test ( self ) : <EOL> pants_run = self . run_pants ( [ <EOL> '<STR_LIT:test>' , <EOL> '<STR_LIT>' ] ) <EOL> self . assert_success ( pants_run ) <EOL> self . assertTrue ( os . path . exists ( '<STR_LIT>' ) ) <EOL> self . assertFalse ( os . path . exists ( '<STR_LIT>' ) ) <EOL> with open ( '<STR_LIT>' ) as f : <EOL> prep_output = f . read ( ) <EOL> expected = """<STR_LIT>""" <EOL> self . assertEquals ( expected , prep_output ) <EOL> self . assert_prep_compile ( ) <EOL> def test_jvm_prep_command_in_binary ( self ) : <EOL> pants_run = self . run_pants ( [ <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' ] ) <EOL> self . assert_success ( pants_run ) <EOL> self . assertTrue ( os . path . exists ( '<STR_LIT>' ) ) <EOL> self . assertFalse ( os . path . exists ( '<STR_LIT>' ) ) <EOL> with open ( '<STR_LIT>' ) as f : <EOL> prep_output = f . read ( ) <EOL> expected = """<STR_LIT>""" <EOL> self . assertEquals ( expected , prep_output ) <EOL> self . assert_prep_compile ( ) </s>
