Code using twisted.names.client.Resolver is hard to unit test
| Newsgroups | gmane.comp.python.twisted.bugs |
|---|---|
| Message-ID | <[email protected]> |
New submission from exarkun <[email protected]>: `Resolver` uses `IReactorUDP` and `IReactorTime`, but also uses the global reactor and does not allow this to be overridden (using public APIs). This means any code using `Resolver` will probably do actual UDP traffic and use the actual system clock. This makes it hard to test. Parameterizing the reactor would all alternate UDP/time implementations to be supplied. This would be nice. Alternatively, Twisted Names could provide a verified fake of the `Resolver` interface, and tests could use that instead of the actual `Resolver`. This fake should have easily controlled behavior, including error cases. ---------- Type : enhancement Component: names Keywords : Priority : low Nosy : ---------- http://twistedmatrix.com/trac/ticket/3908