File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 77import random
88from dataclasses import replace
99from datetime import timedelta
10+ from functools import partial
1011
1112import grpc
1213from pytest import raises
@@ -98,7 +99,16 @@ async def test_list_dispatches(
9899 dispatches = client .list (microgrid_id = 1 )
99100 async for page in dispatches :
100101 for dispatch in page :
101- assert dispatch in client .dispatches (microgrid_id = 1 )
102+ # First find matching id in client.dispatches, then compare
103+ service_side_dispatch = next (
104+ filter (
105+ partial (lambda d , md : d .id == md .id , md = dispatch ),
106+ client .dispatches (microgrid_id = 1 ),
107+ ),
108+ None ,
109+ )
110+
111+ assert dispatch == service_side_dispatch
102112
103113
104114async def test_list_dispatches_no_duration (
You can’t perform that action at this time.
0 commit comments