Opened 6 years ago
Closed 6 years ago
#6848 enhancement closed fixed (fixed)
twisted.names.dns.Messages should be compared based on their field values and section contents
Reported by: | Richard Wall | Owned by: | Tom Prince |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | names | Keywords: | |
Cc: | Branch: |
branches/rich-message-comparison-6848
branch-diff, diff-cov, branch-cov, buildbot |
|
Author: | rwall |
Description
Some twisted.names tests would be much easier to write if dns.Message implemented some of the rich comparison methods and if the Messages were compared based on their field values and section contents.
The simplest way to do this is to inherit from FancyEqMixin.
Which is what we've don in the proposed EDNSMessage class in #5675
And see #6847 where I've added FancyStrMixin for a nicer Message repr.
Change History (4)
comment:1 Changed 6 years ago by
Author: | → rwall |
---|---|
Branch: | → branches/rich-message-comparison-6848 |
comment:2 Changed 6 years ago by
Keywords: | review added |
---|
Ready for review in log:branches/rich-message-comparison-6848
- Added FancyEqMixin and associated tests
- This and #6847 should allow some shared rich comparison tests between dns.Message and dns.EDNSMessage in #5675
- Not sure how adding rich comparison and repr fits in with the compatibility policy.
- It would be nice if showAttributes and compareAttributes could be private, that'll require a change to FancyEq and FancyStrMixin. Good idea?
Build Results:
comment:3 Changed 6 years ago by
Keywords: | review removed |
---|---|
Owner: | set to Tom Prince |
This looks good. I'll merge it. I reordered the attributes and tests to match the constructor argument order, to make it easier to review.
comment:4 Changed 6 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note: See
TracTickets for help on using
tickets.
(In [40844]) Branching to 'rich-message-comparison-6848'