Skip to content

Commit

Permalink
fix: merge from releases/2.x, replace return with log.info()
Browse files Browse the repository at this point in the history
  • Loading branch information
vykozlov committed Aug 26, 2024
1 parent 8b71eaf commit ce1a46a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
5 changes: 2 additions & 3 deletions deepaas/cmd/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def _get_model_name(model_name=None):
:param model_name: name of the model
:return: model object
"""

model_name = CONF.model_name
models = loading.get_available_models("v2")
if model_name:
model_obj = models.get(model_name)
Expand All @@ -202,8 +202,7 @@ def _get_model_name(model_name=None):


# Get the model name
model_name = CONF.model_name
model_name, model_obj = _get_model_name(model_name)
model_name, model_obj = _get_model_name()

# use deepaas.model.v2.wrapper.ModelWrapper(). deepaas>1.2.1dev4
# model_obj = v2_wrapper.ModelWrapper(name=model_name,
Expand Down
9 changes: 9 additions & 0 deletions deepaas/tests/test_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

import mock

from deepaas.cmd import cli
from deepaas.cmd import execute
from deepaas.cmd import run
from deepaas.tests import base
Expand Down Expand Up @@ -63,6 +64,14 @@ def test_run_custom_ip_port(self, m_get_app, m_run_app, m_handle_signals):
)
m_handle_signals.assert_called_once()

# W-I-P
class TestCLI(base.TestCase):
@mock.patch("deepaas.cmd.cli.main")
def test_cli_get_metadata(self, m_cli_get_meta):
self.flags(methods="get_metadata")
with mock.patch.object(sys, "argv", ["deepaas-cli"]):
cli.main()
m_cli_get_meta.assert_called_once()

class TestExecute(base.TestCase):
@mock.patch("deepaas.cmd.execute.prediction")
Expand Down

0 comments on commit ce1a46a

Please sign in to comment.