Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/zeroconf/_history.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ cdef class QuestionHistory:

cdef cython.dict _history

cpdef add_question_at_time(self, DNSQuestion question, float now, cython.set known_answers)
cpdef add_question_at_time(self, DNSQuestion question, double now, cython.set known_answers)

@cython.locals(than=cython.double, previous_question=cython.tuple, previous_known_answers=cython.set)
cpdef bint suppresses(self, DNSQuestion question, cython.double now, cython.set known_answers)
@cython.locals(than=double, previous_question=cython.tuple, previous_known_answers=cython.set)
cpdef bint suppresses(self, DNSQuestion question, double now, cython.set known_answers)

@cython.locals(than=cython.double, now_known_answers=cython.tuple)
cpdef async_expire(self, cython.double now)
@cython.locals(than=double, now_known_answers=cython.tuple)
cpdef async_expire(self, double now)
9 changes: 7 additions & 2 deletions tests/test_history.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,16 @@ def test_question_suppression():
def test_question_expire():
history = QuestionHistory()

question = r.DNSQuestion("_hap._tcp._local.", const._TYPE_PTR, const._CLASS_IN)
now = r.current_time_millis()
question = r.DNSQuestion("_hap._tcp._local.", const._TYPE_PTR, const._CLASS_IN)
other_known_answers: Set[r.DNSRecord] = {
r.DNSPointer(
"_hap._tcp.local.", const._TYPE_PTR, const._CLASS_IN, 10000, 'known-to-other._hap._tcp.local.'
"_hap._tcp.local.",
const._TYPE_PTR,
const._CLASS_IN,
10000,
'known-to-other._hap._tcp.local.',
created=now,
)
}
history.add_question_at_time(question, now, other_known_answers)
Expand Down