Skip to content

Commit cc904ab

Browse files
author
Ziqun Ye
committed
fix the tests
1 parent 5b2f44d commit cc904ab

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

ads/opctl/backend/base.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from typing import Dict
99

1010
from ads.common.auth import create_signer
11-
from ads.common.oci_client import OCIClientFactory
11+
1212

1313

1414
class Backend:
@@ -20,12 +20,6 @@ def __init__(self, config: Dict) -> None:
2020
self.profile = config["execution"].get("oci_profile", None)
2121
self.oci_config = config["execution"].get("oci_config", None)
2222

23-
self.oci_auth = create_signer(
24-
self.auth_type,
25-
self.oci_config,
26-
self.profile,
27-
)
28-
self.client = OCIClientFactory(**self.oci_auth).data_science
2923

3024
@abstractmethod
3125
def run(self) -> Dict:

ads/opctl/backend/local.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
run_container,
5252
)
5353
from ads.pipeline.ads_pipeline import Pipeline, PipelineStep
54-
54+
from ads.common.oci_client import OCIClientFactory
5555

5656
class CondaPackNotFound(Exception): # pragma: no cover
5757
pass
@@ -663,6 +663,12 @@ def __init__(self, config: Dict) -> None:
663663
dictionary of configurations
664664
"""
665665
super().__init__(config)
666+
self.oci_auth = create_signer(
667+
self.auth_type,
668+
self.oci_config,
669+
self.profile,
670+
)
671+
self.client = OCIClientFactory(**self.oci_auth).data_science
666672

667673
def predict(self) -> None:
668674
"""

tests/unitary/with_extras/opctl/test_opctl_local_model_deployment_backend.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66

77
from mock import ANY, patch, MagicMock, PropertyMock
88
import pytest
9-
from ads.opctl.backend.local import LocalModelDeploymentBackend, ModelCustomMetadata, os
10-
from ads.opctl.backend.base import create_signer, OCIClientFactory
9+
from ads.opctl.backend.local import LocalModelDeploymentBackend, ModelCustomMetadata, os, create_signer, OCIClientFactory
10+
1111

1212

1313
class TestLocalModelDeploymentBackend:

0 commit comments

Comments
 (0)