update twisted test code