<s> from __future__ import ( absolute_import , division , generators , nested_scopes , print_function , <EOL> unicode_literals , with_statement ) <EOL> import os <EOL> from pants_test . pants_run_integration_test import PantsRunIntegrationTest <EOL> from pants_test . subsystem . subsystem_util import subsystem_instance <EOL> from pants_test . testutils . file_test_util import exact_files <EOL> from pants . contrib . go . subsystems . go_distribution import GoDistribution <EOL> class GoThriftGenIntegrationTest ( PantsRunIntegrationTest ) : <EOL> def test_go_thrift_gen_simple ( self ) : <EOL> with self . temporary_workdir ( ) as workdir : <EOL> args = [ '<STR_LIT>' , <EOL> '<STR_LIT>' ] <EOL> pants_run = self . run_pants_with_workdir ( args , workdir ) <EOL> self . assert_success ( pants_run ) <EOL> with subsystem_instance ( GoDistribution . Factory ) as factory : <EOL> go_dist = factory . create ( ) <EOL> go_dist . create_go_cmd ( '<STR_LIT>' , args = [ '<STR_LIT>' ] ) . check_output ( ) . strip ( ) <EOL> go_dist . create_go_cmd ( '<STR_LIT>' , args = [ '<STR_LIT>' ] ) . check_output ( ) . strip ( ) <EOL> expected_files = { <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> } <EOL> go_thrift_contents = os . listdir ( os . path . join ( workdir , '<STR_LIT>' , '<STR_LIT>' ) ) <EOL> self . assertEqual ( len ( go_thrift_contents ) , <NUM_LIT:1> ) <EOL> root = os . path . join ( workdir , '<STR_LIT>' , '<STR_LIT>' , go_thrift_contents [ <NUM_LIT:0> ] , <EOL> '<STR_LIT>' , '<STR_LIT>' ) <EOL> self . assertEquals ( sorted ( expected_files ) , sorted ( exact_files ( root ) ) ) <EOL> def test_go_thrift_gen_and_compile ( self ) : <EOL> with self . temporary_workdir ( ) as workdir : <EOL> args = [ '<STR_LIT>' , <EOL> '<STR_LIT>' ] <EOL> pants_run = self . run_pants_with_workdir ( args , workdir ) <EOL> self . assert_success ( pants_run ) </s>
