def METHOD_NAME(self, expected_sources, expected_targets, expected_weights, expected_delays, rule):
    """Gather connections from all processes and assert against expected connections"""
    conns = nest.GetConnections()
    projections = [[s, t] for s, t in zip(conns.source, conns.target)]
    weights = conns.weight
    delays = conns.delay
    if rule == "one_to_one":
        expected_projections = np.array([[s, t] for s, t in zip(expected_sources, expected_targets)])
    elif rule == "all_to_all":
        expected_projections = np.array([[s, t] for s in expected_sources for t in expected_targets])
    else:
        self.assertFalse(True, "rule={} is not valid".format(rule))
    expected_weights = (
        expected_weights
        if type(expected_weights) is np.ndarray
        else expected_weights * np.ones(len(expected_projections))
    )
    expected_delays = (
        expected_delays
        if type(expected_delays) is np.ndarray
        else expected_delays * np.ones(len(expected_projections))
    )
    recv_projections = self.comm.gather(projections, root=0)
    recv_weights = self.comm.gather(weights, root=0)
    recv_delays = self.comm.gather(delays, root=0)
    if self.comm.Get_rank() == 0:
        # Flatten the projection lists to a single list of projections
        recv_projections = np.array([proj for part in recv_projections for proj in part])
        recv_weights = np.array([w for part in recv_weights for w in part])
        recv_delays = np.array([proj for part in recv_delays for proj in part])
        # Results must be sorted to make comparison possible
        np.testing.assert_array_equal(np.sort(recv_projections, axis=0), np.sort(expected_projections, axis=0))
        np.testing.assert_array_almost_equal(np.sort(recv_weights, axis=0), np.sort(expected_weights, axis=0))
        np.testing.assert_array_almost_equal(np.sort(recv_delays, axis=0), np.sort(expected_delays, axis=0))
    else:
        self.assertIsNone(recv_projections)
        self.assertIsNone(recv_weights)
        self.assertIsNone(recv_delays)