def test_arrange(): rects = r1, r2 = R(0, 0, 10, 30), R(10, 0, 20, 10) cloud = RectangleCloud(rects) cloud.arrange() assert r1.x == 20 and r2.x == 0 or r1.x == 0 and r2.x == 10 assert r1.y == 0 and r2.y == 10 assert r1.w == 10 assert r1.h == 30 assert r2.w == 20 assert r2.h == 10