Opened 8 years ago
Last modified 7 years ago
#6379 enhancement new
Create a verified fake resolver
Reported by: | Richard Wall | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | names | Keywords: | |
Cc: | Branch: | ||
Author: |
Description
twisted.names.test.test_client includes a FakeResolver class used to test the module level lookup? functions in twisted.names.client.
This fake resolver may can be used in place of:
- source:twisted/internet/test/connectionmixins.py FakeResolver
- source:twisted/names/test/test_srvconnect.py FakeResolver
FakeResolver class should be moved to a new module twisted.names.fakeresolver
It needs testing, to ensure that it matches the real IResolver interface; including methods, method signatures, return types and exceptions raised.
Exarkun recommends using fakepwd.py as the best current example of a verified fake:
- source:trunk/twisted/python/fakepwd.py
...and its tests:
- source:trunk/twisted/python/test/test_fakepwd.py
This idea was originally proposed in #3908 but wasn't actually needed for the resolution of that ticket.
Note: See
TracTickets for help on using
tickets.
(In [39320]) prototype FakeResolver for testing root.Resolver(resolver) and other dns client code. refs #6095, #6379