'Conversion from graph to array to graph with nodelist.'

def test_nodelist(self):

    P4 = path_graph(4)
    P3 = path_graph(3)
    nodelist = list(P3)
    A = nx.to_numpy_array(P4, nodelist=nodelist)
    GA = nx.Graph(A)
    self.assert_equal(GA, P3)
    nodelist += [nodelist[0]]
    assert_raises(nx.NetworkXError, nx.to_numpy_array, P3, nodelist=nodelist)
