Python: fixed a test case for Graph.density()