def test_deprecation(self): self.assertWarns(DeprecationWarning, ("dsu is deprecated since Twisted 10.1. " "Use the built-in sorted() instead."), __file__, lambda: util.dsu([], lambda: 0))
def test_dsu(self): L = [Foo(x) for x in range(20, 9, -1)] L2 = util.dsu(L, lambda o: o.x) self.assertEquals(range(10, 21), [o.x for o in L2])