<s> import unittest <EOL> import sys <EOL> import os <EOL> import mock <EOL> from tests import step <EOL> sys . path . append ( os . path . join ( os . path . dirname ( __file__ ) , '<STR_LIT:..>' , '<STR_LIT:..>' , '<STR_LIT>' , '<STR_LIT>' ) ) <EOL> from play . application import PlayApplication <EOL> class JvmVersionFlag ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . common = { <EOL> '<STR_LIT>' : os . path . normpath ( os . path . dirname ( os . path . join ( os . path . dirname ( __file__ ) , '<STR_LIT:..>' , '<STR_LIT:..>' , '<STR_LIT:..>' ) ) ) , <EOL> '<STR_LIT:version>' : '<STR_LIT>' , <EOL> '<STR_LIT:id>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : <NUM_LIT> <EOL> } <EOL> @ mock . patch ( '<STR_LIT>' , return_value = '<STR_LIT>' ) <EOL> def testWithFlag ( self , mock ) : <EOL> play_env = self . common . copy ( ) <EOL> play_env . update ( { '<STR_LIT>' : '<STR_LIT>' } ) <EOL> play_app = PlayApplication ( '<STR_LIT>' , play_env , True ) <EOL> play_app . java_cmd ( [ ] ) <EOL> step ( '<STR_LIT>' ) <EOL> self . assert_ ( not mock . called ) <EOL> @ mock . patch ( '<STR_LIT>' , return_value = '<STR_LIT>' ) <EOL> def testWithoutFlag ( self , mock ) : <EOL> play_env = self . common . copy ( ) <EOL> play_app = PlayApplication ( '<STR_LIT>' , play_env , True ) <EOL> play_app . java_cmd ( [ ] ) <EOL> step ( '<STR_LIT>' ) <EOL> self . assert_ ( mock . called ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> unittest . main ( ) </s>
