Skip to content

Commit

Permalink
fix: erroneously removed get_flow_id() method on Gladier Clients
Browse files Browse the repository at this point in the history
Method was removed with the new FlowManager class, which now handles
deployment of the flow. The re-added method calls get_flow_id() on the
manager class.
  • Loading branch information
NickolausDS committed Jan 31, 2023
1 parent 2fafd9d commit ea2232b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
6 changes: 6 additions & 0 deletions gladier/client.py
Expand Up @@ -298,6 +298,12 @@ def get_funcx_function_ids(self):
funcx_ids[name] = val
return funcx_ids

def get_flow_id(self) -> str:
"""
Get the flow id from the flows manager class.
"""
return self.flows_manager.get_flow_id()

def get_input(self) -> dict:
"""
Get funcx function ids, funcx endpoints, and each tool's default input. Default
Expand Down
5 changes: 5 additions & 0 deletions gladier/tests/test_client.py
@@ -1,4 +1,5 @@
from gladier.tests.test_data.gladier_mocks import MockGladierClient
from gladier.managers import FlowsManager


def test_get_input(logged_in):
Expand All @@ -8,6 +9,10 @@ def test_get_input(logged_in):
}}


def test_get_flow_id(logged_in):
assert MockGladierClient().get_flow_id() is None


def test_get_input_from_aliased_tool(logged_in):

class MockGladierClientAlias(MockGladierClient):
Expand Down
9 changes: 9 additions & 0 deletions gladier/tests/test_flows_manager.py
Expand Up @@ -65,6 +65,15 @@ def test_custom_scope_id(logged_out):
assert scope in cli.login_manager.missing_authorizers


def test_custom_scope_id():
fm = FlowsManager(flow_id='foo')
cli = MockGladierClient(flows_manager=fm)
assert cli.flows_manager == fm
assert fm.flow_id == 'foo'
assert fm.get_flow_id() == 'foo'
assert cli.get_flow_id() == 'foo'


def test_dependent_scope_change_run_flow(auto_login, mock_flows_client,
mock_dependent_token_change_error,
monkeypatch):
Expand Down

0 comments on commit ea2232b

Please sign in to comment.