Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastianMorawiec committed May 23, 2024
1 parent e1b6922 commit 43a2546
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 13 deletions.
2 changes: 1 addition & 1 deletion projects/orquestra-sdk/docs/examples/tests/test_secrets.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@

from unittest.mock import Mock

import orquestra.workflow_shared.secrets._client
import pytest
import responses
from orquestra.workflow_shared.schema import configs

import orquestra.sdk._client._base._config
import orquestra.sdk._client.secrets._client


class Snippets:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from typing import Any, Dict, List, Optional, Union
from unittest.mock import ANY, Mock, call, create_autospec

import orquestra.workflow_runtime.secrets
import orquestra.workflow_shared.secrets
import pytest
from orquestra.workflow_runtime._ray import _build_workflow, _client
from orquestra.workflow_shared import parse_git_url, serde
Expand Down Expand Up @@ -90,9 +90,9 @@ def test_uses_default_protocol(self, git_url: GitURL):
assert url == "https://github.com/zapata-engineering/orquestra-sdk"

def test_with_password(self, monkeypatch: pytest.MonkeyPatch, git_url: GitURL):
secrets_get = create_autospec(orquestra.workflow_runtime.secrets.get)
secrets_get = create_autospec(orquestra.workflow_shared.secrets.get)
secrets_get.return_value = "<mocked secret>"
monkeypatch.setattr(orquestra.workflow_runtime.secrets, "get", secrets_get)
monkeypatch.setattr(orquestra.workflow_shared.secrets, "get", secrets_get)

secret_name = "my_secret"
secret_config = "secret config"
Expand Down
4 changes: 2 additions & 2 deletions projects/orquestra-sdk/tests/sdk/api/test_task_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
import typing as t
from unittest.mock import Mock, create_autospec

import orquestra.workflow_runtime
import pytest
from orquestra.workflow_runtime._ray import _build_workflow
from orquestra.workflow_shared import serde
from orquestra.workflow_shared.abc import RuntimeInterface
from orquestra.workflow_shared.exceptions import TaskRunNotFound
Expand Down Expand Up @@ -542,7 +542,7 @@ def mock_ray_context(monkeypatch):
task_inv_id = "inv-1-generate-data"
task_run_id = f"{wf_run_id}@{task_inv_id}"
monkeypatch.setattr(
_build_workflow,
orquestra.workflow_runtime,
"get_current_ids",
Mock(return_value=(wf_run_id, task_inv_id, task_run_id)),
)
Expand Down
2 changes: 1 addition & 1 deletion projects/orquestra-sdk/tests/sdk/secrets/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
from unittest.mock import Mock

import pytest
from orquestra.workflow_runtime.secrets import _auth, _exceptions, _models
from orquestra.workflow_shared import exceptions as sdk_exc
from orquestra.workflow_shared.secrets import _auth, _exceptions, _models

from orquestra import sdk

Expand Down
2 changes: 1 addition & 1 deletion projects/orquestra-sdk/tests/sdk/secrets/test_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
from pathlib import Path

import pytest
from orquestra.workflow_runtime.secrets import _auth
from orquestra.workflow_shared import exceptions
from orquestra.workflow_shared.schema import configs
from orquestra.workflow_shared.secrets import _auth


class TestAuthorizedClient:
Expand Down
4 changes: 2 additions & 2 deletions projects/orquestra-sdk/tests/sdk/secrets/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"""
import pytest
import responses
from orquestra.workflow_runtime.secrets import _exceptions, _models
from orquestra.workflow_runtime.secrets._client import SecretsClient
from orquestra.workflow_shared.secrets import _exceptions, _models
from orquestra.workflow_shared.secrets._client import SecretsClient

from . import resp_mocks

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
from unittest.mock import create_autospec

import pytest
from orquestra.workflow_runtime.secrets import _client, _models
from orquestra.workflow_shared import exceptions, serde
from orquestra.workflow_shared._spaces._structs import ProjectRef
from orquestra.workflow_shared.dates import _dates
from orquestra.workflow_shared.schema import ir
from orquestra.workflow_shared.schema.workflow_run import State, WorkflowRunId
from orquestra.workflow_shared.secrets import _client, _models

from orquestra import sdk
from orquestra.sdk._client._base._in_process_runtime import InProcessRuntime
Expand Down
3 changes: 1 addition & 2 deletions projects/orquestra-sdk/tests/sdk/test_traversal.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
import orquestra.workflow_shared.schema.ir as ir
import pytest
from git.remote import Remote
from orquestra.workflow_runtime import secrets
from orquestra.workflow_shared import dispatch, exceptions, serde
from orquestra.workflow_shared import dispatch, exceptions, secrets, serde
from orquestra.workflow_shared.packaging import _versions

from orquestra.sdk._client._base import _dsl, _traversal, _workflow
Expand Down

0 comments on commit 43a2546

Please sign in to comment.