def METHOD_NAME(self, close, connect):
    with self.array_connection as array_mediator:
        self.assertEqual(True, self.array_connection.connected)
        self.assertEqual(self.endpoint, array_mediator.endpoint)
    connect.assert_called_with()
    close.assert_called_with()