<s> from __future__ import ( absolute_import , division , generators , nested_scopes , print_function , <EOL> unicode_literals , with_statement ) <EOL> from pants_test . pants_run_integration_test import PantsRunIntegrationTest <EOL> class ThriftLinterTest ( PantsRunIntegrationTest ) : <EOL> lint_error_token = "<STR_LIT>" <EOL> @ classmethod <EOL> def hermetic ( cls ) : <EOL> return True <EOL> def run_pants ( self , command , config = None , stdin_data = None , extra_env = None , ** kwargs ) : <EOL> full_config = { <EOL> '<STR_LIT>' : { <EOL> '<STR_LIT>' : [ "<STR_LIT>" ] , <EOL> '<STR_LIT>' : [ "<STR_LIT>" ] <EOL> } , <EOL> } <EOL> if config : <EOL> for scope , scoped_cfgs in config . items ( ) : <EOL> updated = full_config . get ( scope , { } ) <EOL> updated . update ( scoped_cfgs ) <EOL> full_config [ scope ] = updated <EOL> return super ( ThriftLinterTest , self ) . run_pants ( command , full_config , stdin_data , extra_env , <EOL> ** kwargs ) <EOL> @ staticmethod <EOL> def thrift_test_target ( name ) : <EOL> return '<STR_LIT>' + name <EOL> def test_good ( self ) : <EOL> cmd = [ '<STR_LIT>' , self . thrift_test_target ( '<STR_LIT>' ) ] <EOL> pants_run = self . run_pants ( cmd ) <EOL> self . assert_success ( pants_run ) <EOL> self . assertNotIn ( self . lint_error_token , pants_run . stdout_data ) <EOL> def test_skip_skips_execution ( self ) : <EOL> cmd = [ '<STR_LIT>' , '<STR_LIT>' , self . thrift_test_target ( '<STR_LIT>' ) ] <EOL> pants_run = self . run_pants ( cmd ) <EOL> self . assert_success ( pants_run ) <EOL> self . assertNotIn ( self . lint_error_token , pants_run . stdout_data ) <EOL> def test_bad_default ( self ) : <EOL> cmd = [ '<STR_LIT>' , self . thrift_test_target ( '<STR_LIT>' ) ] <EOL> pants_run = self . run_pants ( cmd ) <EOL> self . assert_success ( pants_run ) <EOL> self . assertIn ( self . lint_error_token , pants_run . stdout_data ) <EOL> def test_bad_strict ( self ) : <EOL> cmd = [ '<STR_LIT>' , self . thrift_test_target ( '<STR_LIT>' ) ] <EOL> pants_run = self . run_pants ( cmd ) <EOL> self . assert_failure ( pants_run ) <EOL> self . assertIn ( self . lint_error_token , pants_run . stdout_data ) <EOL> def test_bad_non_strict ( self ) : <EOL> cmd = [ '<STR_LIT>' , self . thrift_test_target ( '<STR_LIT>' ) ] <EOL> pants_run = self . run_pants ( cmd ) <EOL> self . assert_success ( pants_run ) <EOL> self . assertIn ( self . lint_error_token , pants_run . stdout_data ) <EOL> def test_bad_default_override ( self ) : <EOL> cmd = [ '<STR_LIT>' , '<STR_LIT>' , self . thrift_test_target ( '<STR_LIT>' ) ] <EOL> pants_run = self . run_pants ( cmd ) <EOL> self . assert_failure ( pants_run ) <EOL> self . assertIn ( self . lint_error_token , pants_run . stdout_data ) <EOL> def test_bad_strict_override ( self ) : <EOL> cmd = [ '<STR_LIT>' , '<STR_LIT>' , self . thrift_test_target ( '<STR_LIT>' ) ] <EOL> pants_run = self . run_pants ( cmd ) <EOL> self . assert_success ( pants_run ) <EOL> self . assertIn ( self . lint_error_token , pants_run . stdout_data ) <EOL> def test_bad_non_strict_override ( self ) : <EOL> cmd = [ '<STR_LIT>' , '<STR_LIT>' , self . thrift_test_target ( '<STR_LIT>' ) ] <EOL> pants_run = self . run_pants ( cmd ) <EOL> self . assert_failure ( pants_run ) <EOL> self . assertIn ( self . lint_error_token , pants_run . stdout_data ) <EOL> def test_bad_pants_ini_strict ( self ) : <EOL> cmd = [ '<STR_LIT>' , self . thrift_test_target ( '<STR_LIT>' ) ] <EOL> pants_ini_config = { '<STR_LIT>' : { '<STR_LIT:strict>' : True } } <EOL> pants_run = self . run_pants ( cmd , config = pants_ini_config ) <EOL> self . assert_failure ( pants_run ) <EOL> self . assertIn ( self . lint_error_token , pants_run . stdout_data ) <EOL> def test_bad_pants_ini_strict_overridden ( self ) : <EOL> cmd = [ '<STR_LIT>' , '<STR_LIT>' , self . thrift_test_target ( '<STR_LIT>' ) ] <EOL> pants_ini_config = { '<STR_LIT>' : { '<STR_LIT:strict>' : True } } <EOL> pants_run = self . run_pants ( cmd , config = pants_ini_config ) <EOL> self . assert_success ( pants_run ) <EOL> self . assertIn ( self . lint_error_token , pants_run . stdout_data ) </s>
