ref: Make list_flows async (#5222)

* Make list_flows async

* Keep sync list_flows method for backward compatibility
This commit is contained in:
Christophe Bornet 2024-12-12 17:02:43 +01:00 • committed by GitHub
commit 2e19403660
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 42 additions and 38 deletions

View file

@ -20,13 +20,13 @@ def component(
)
def test_list_flows_flow_objects(component):
flows = component.list_flows()
async def test_list_flows_flow_objects(component):
flows = await component.alist_flows()
are_flows = [isinstance(flow, Data) for flow in flows]
flow_types = [type(flow) for flow in flows]
assert all(are_flows), f"Expected all flows to be Data objects, got {flow_types}"
def test_list_flows_return_type(component):
flows = component.list_flows()
async def test_list_flows_return_type(component):
flows = await component.alist_flows()
assert isinstance(flows, list)