MCPcopy Index your code
hub / github.com/microsoft/MarS / test_priority_queue

Function test_priority_queue

mlib/test/test_engine.py:11–23  ·  view source on GitHub ↗

Test priority queue.

()

Source from the content-addressed store, hash-verified

9
10
11def test_priority_queue() -> None:
12 """Test priority queue."""
13 engine: Engine = Engine(exchange=None, verbose=True) # type: ignore
14 now = Timestamp("2020-02-02")
15 yesterday = Timestamp("2020-02-01")
16 engine.push_event(Event(now))
17 engine.push_event(Event(yesterday))
18 pop_event0 = engine._pop_event() # type: ignore # noqa: SLF001
19 pop_event1 = engine._pop_event() # type: ignore # noqa: SLF001
20 assert pop_event0.time == yesterday
21 assert pop_event0.event_id == 1
22 assert pop_event1.time == now
23 assert pop_event1.event_id == 0
24
25
26def test_engine_run() -> None:

Callers 1

test_engine.pyFile · 0.85

Calls 4

push_eventMethod · 0.95
_pop_eventMethod · 0.95
EngineClass · 0.90
EventClass · 0.90

Tested by

no test coverage detected