<s> import os <EOL> from awscli . testutils import BaseAWSCommandParamsTest , FileCreator , mock <EOL> from awscli . compat import six <EOL> class TestGetGameSessionLog ( BaseAWSCommandParamsTest ) : <EOL> prefix = '<STR_LIT>' <EOL> def setUp ( self ) : <EOL> super ( TestGetGameSessionLog , self ) . setUp ( ) <EOL> self . files = FileCreator ( ) <EOL> self . filename = os . path . join ( self . files . rootdir , '<STR_LIT>' ) <EOL> self . urlopen_patch = mock . patch ( <EOL> '<STR_LIT>' ) <EOL> self . contents = b'<STR_LIT>' <EOL> self . urlopen_mock = self . urlopen_patch . start ( ) <EOL> self . urlopen_mock . return_value = six . BytesIO ( self . contents ) <EOL> def tearDown ( self ) : <EOL> super ( TestGetGameSessionLog , self ) . tearDown ( ) <EOL> self . files . remove_all ( ) <EOL> self . urlopen_patch . stop ( ) <EOL> def test_get_game_session_log ( self ) : <EOL> cmdline = self . prefix <EOL> cmdline += '<STR_LIT>' <EOL> cmdline += '<STR_LIT>' % self . filename <EOL> self . parsed_responses = [ { '<STR_LIT>' : '<STR_LIT>' } ] <EOL> stdout , stderr , rc = self . run_cmd ( cmdline , expected_rc = <NUM_LIT:0> ) <EOL> self . assertEqual ( len ( self . operations_called ) , <NUM_LIT:1> ) <EOL> self . assertEqual ( <EOL> self . operations_called [ <NUM_LIT:0> ] [ <NUM_LIT:0> ] . name , '<STR_LIT>' ) <EOL> self . assertEqual ( <EOL> self . operations_called [ <NUM_LIT:0> ] [ <NUM_LIT:1> ] , <EOL> { '<STR_LIT>' : '<STR_LIT>' } <EOL> ) <EOL> self . assertTrue ( os . path . exists ( self . filename ) ) <EOL> with open ( self . filename , '<STR_LIT:rb>' ) as f : <EOL> self . assertEqual ( f . read ( ) , self . contents ) <EOL> self . assertIn ( <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' % self . filename , <EOL> stdout <EOL> ) </s>
