Skip to content

Commit

Permalink
Addressed issue with test_globus_flow.py, where MockGlobusComputeClie…
Browse files Browse the repository at this point in the history
…nt was inheriting from globus_sdk.Client: #27
  • Loading branch information
davramov committed Oct 2, 2024
1 parent 54e107d commit 1db4de2
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions orchestration/_tests/test_globus_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from uuid import UUID, uuid4
import warnings

from globus_compute_sdk.sdk.client import Client
from prefect.blocks.system import JSON, Secret
from prefect.testing.utilities import prefect_test_harness
import pytest
Expand Down Expand Up @@ -101,29 +100,29 @@ def __init__(self) -> None:


# Mock the Client class to avoid real network calls
class MockGlobusComputeClient(Client):
class MockGlobusComputeClient:
def __init__(self, *args, **kwargs):
# Skip initializing the real client
# No real initialization, as this is a mock
pass

def version_check(self):
# Mock version check to do nothing
pass

def run(self, *args, **kwargs):
# Mock run to return a fake task ID
# Return a mock task ID
return "mock_task_id"

def get_task(self, task_id):
# Mock getting task to return a successful result
# Return a mock task response
return {
"pending": False,
"status": "success",
"result": "mock_result"
}

def get_result(self, task_id):
# Mock getting the result of a task
# Return a mock result
return "mock_result"


Expand Down

0 comments on commit 1db4de2

Please sign in to comment.