'Tests that the Wiener index of the path graph is correctly
computed.'

def test_path_graph(self):

    n = 9
    G = path_graph(n)
    expected = (2 * sum(((i * (n - i)) for i in range(1, ((n // 2) + 1)))))
    actual = wiener_index(G)
    eq_(expected, actual)
