def test_fiedler(): f = fiedler([]) assert_equal(f.size, 0) f = fiedler([123.]) assert_array_equal(f, np.array([[0.]])) f = fiedler(np.arange(1, 7)) des = np.array([[0, 1, 2, 3, 4, 5], [1, 0, 1, 2, 3, 4], [2, 1, 0, 1, 2, 3], [3, 2, 1, 0, 1, 2], [4, 3, 2, 1, 0, 1], [5, 4, 3, 2, 1, 0]]) assert_array_equal(f, des)