def test_get_game_session_log(self):
        cmdline = self.prefix
        cmdline += ' --game-session-id mysession'
        cmdline += ' --save-as %s' % self.filename

        self.parsed_responses = [{'PreSignedUrl': 'myurl'}]
        stdout, stderr, rc = self.run_cmd(cmdline, expected_rc=0)
        self.assertEqual(len(self.operations_called), 1)
        self.assertEqual(
            self.operations_called[0][0].name, 'GetGameSessionLogUrl')
        self.assertEqual(
            self.operations_called[0][1],
            {'GameSessionId': 'mysession'}
        )

        # Ensure the contents were saved to the file
        self.assertTrue(os.path.exists(self.filename))
        with open(self.filename, 'rb') as f:
            self.assertEqual(f.read(), self.contents)

        # Ensure the output is as expected
        self.assertIn(
            'Successfully downloaded log archive for game session '
            'mysession to %s' % self.filename,
            stdout
        )
dataset/ETHPy150Open aws/aws-cli/tests/functional/gamelift/test_get_game_session_log.py/TestGetGameSessionLog.test_get_game_session_log/original