Test to generate a networkx graph