

def setUp(self):
    context.clear()
    conn_parameters['key'] = ''.join((random.choice((string.ascii_lowercase + string.digits)) for _ in range(50)))
    self.patcher = patch('boto3.session.Session')
    self.addCleanup(self.patcher.stop)
    mock_session = self.patcher.start()
    session_instance = mock_session.return_value
    self.conn = MagicMock()
    session_instance.client.return_value = self.conn

dataset/ETHPy150Open saltstack/salt/tests/unit/states/boto_apigateway_test.py BotoApiGatewayStateTestCaseBase.setUp/original