Surely you want an undirected graph here? It's a pretty weak test anyway, and you're also not verifying the entire return value.