MCPcopy
hub / github.com/gorakhargosh/watchdog / test_prevent_consecutive

Function test_prevent_consecutive

tests/test_skip_repeats_queue.py:52–64  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

50
51
52def test_prevent_consecutive():
53 q = SkipRepeatsQueue()
54
55 e1 = (2, "fred")
56 e2 = (2, "george")
57
58 q.put(e1)
59 q.put(e1) # repeat the first entry (this shouldn't get added)
60 q.put(e2)
61
62 assert e1 == q.get()
63 assert e2 == q.get()
64 assert q.empty()
65
66
67def test_consecutives_allowed_across_empties():

Callers

nothing calls this directly

Calls 3

putMethod · 0.95
SkipRepeatsQueueClass · 0.90
getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…