Ticket #6095 enhancement new

Opened 8 months ago

Last modified 5 months ago

Get rid of the circular dependency between root and client in twisted.names

Reported by: exarkun Owned by: borko
Priority: normal Milestone:
Component: names Keywords:
Cc: borko84@… Branch:
Author: Launchpad Bug:

Description

twisted.names.client uses twisted.names.root to construct the object returned by createResolver (sometimes). twisted.names.root uses twisted.names.client to bootstrap itself.

This circularity could be removed by giving twisted.names.root.Resolver a resolver argument so it doesn't need to import twisted.names.client to create one.

Attachments

6095_v1.diff Download (3.0 KB) - added by borko 5 months ago.

Change History

1

Changed 5 months ago by borko

  • keywords review added

I guess it's obsolate. root imports only dns, common, error from twisted.names. Cannot see client. So I think it should be closed.

2

Changed 5 months ago by borko

3

Changed 5 months ago by borko

  • keywords review added

pls give an idea of easiest unit testing this one.

4

Changed 5 months ago by borko

  • cc borko84@… added
  • branch_author set to borko

5

Changed 5 months ago by exarkun

  • owner set to borko
  • keywords review removed
  • branch_author borko deleted

As long as all the code is exercised by existing unit tests, this kind of change doesn't require new unit tests (perhaps partly because it is too difficult to test, and we lack the tools to do so, but also because the unit tests exist to demonstrate the code works, not that it has a particular shape - any shape that makes the unit tests pass is fine, as far as the tests go; and then as developers we can apply additional constraints like "shorter is better than longer" or "easier to read is better than harder to read").

You can use  coverage.py to verify that the changed code really is exercised by the unit tests (or discover that it is not).

Note: See TracTickets for help on using tickets.