from __future__ import absolute_import
from __future__ import print_function

from mock import patch


@patch("sqlalchemy.create_engine")
def test_status_no_db_access(create_engine_mock):
    """
    Tests that status does not try to access the database
    """
    try:
        from kolibri.utils import cli

        cli.status.callback()
    except SystemExit:
        pass
    create_engine_mock.assert_not_called()


@patch("sqlalchemy.create_engine")
def test_stop_no_db_access(create_engine_mock):
    """
    Tests that status does not try to access the database
    """
    try:
        from kolibri.utils import cli

        cli.stop.callback()
    except SystemExit:
        pass
    create_engine_mock.assert_not_called()

from __future__ import absolute_import
from __future__ import print_function

from mock import patch


@patch("sqlalchemy.create_engine")
def test_status_no_db_access(create_engine_mock):
    """
    Tests that status does not try to access the database
    """
    try:
        from kolibri.utils import cli

        cli.status.callback()
    except SystemExit:
        pass
    create_engine_mock.assert_not_called()


@patch("sqlalchemy.create_engine")
def test_stop_no_db_access(create_engine_mock):
    """
    Tests that status does not try to access the database
    """
    try:
        from kolibri.utils import cli

        cli.stop.callback()
    except SystemExit:
        pass
    create_engine_mock.assert_not_called()


@patch("kolibri.utils.options.read_options_file")
def test_import_no_options_evaluation(read_options_mock):
    from kolibri.utils import cli  # noqa F401

    read_options_mock.assert_not_called()

Add regression test against options evaluation during import in cli.
Add regression test against options evaluation during import in cli.

  from __future__ import absolute_import
  from __future__ import print_function
  
  from mock import patch
  
  
  @patch("sqlalchemy.create_engine")
  def test_status_no_db_access(create_engine_mock):
      """
      Tests that status does not try to access the database
      """
      try:
          from kolibri.utils import cli
  
          cli.status.callback()
      except SystemExit:
          pass
      create_engine_mock.assert_not_called()
  
  
  @patch("sqlalchemy.create_engine")
  def test_stop_no_db_access(create_engine_mock):
      """
      Tests that status does not try to access the database
      """
      try:
          from kolibri.utils import cli
  
          cli.stop.callback()
      except SystemExit:
          pass
      create_engine_mock.assert_not_called()
  
+ 
+ @patch("kolibri.utils.options.read_options_file")
+ def test_import_no_options_evaluation(read_options_mock):
+     from kolibri.utils import cli  # noqa F401
+ 
+     read_options_mock.assert_not_called()
+ 
Add regression test against options evaluation during import in cli.
## Code Before:
from __future__ import absolute_import
from __future__ import print_function

from mock import patch


@patch("sqlalchemy.create_engine")
def test_status_no_db_access(create_engine_mock):
    """
    Tests that status does not try to access the database
    """
    try:
        from kolibri.utils import cli

        cli.status.callback()
    except SystemExit:
        pass
    create_engine_mock.assert_not_called()


@patch("sqlalchemy.create_engine")
def test_stop_no_db_access(create_engine_mock):
    """
    Tests that status does not try to access the database
    """
    try:
        from kolibri.utils import cli

        cli.stop.callback()
    except SystemExit:
        pass
    create_engine_mock.assert_not_called()

## Instruction:
Add regression test against options evaluation during import in cli.
## Code After:
from __future__ import absolute_import
from __future__ import print_function

from mock import patch


@patch("sqlalchemy.create_engine")
def test_status_no_db_access(create_engine_mock):
    """
    Tests that status does not try to access the database
    """
    try:
        from kolibri.utils import cli

        cli.status.callback()
    except SystemExit:
        pass
    create_engine_mock.assert_not_called()


@patch("sqlalchemy.create_engine")
def test_stop_no_db_access(create_engine_mock):
    """
    Tests that status does not try to access the database
    """
    try:
        from kolibri.utils import cli

        cli.stop.callback()
    except SystemExit:
        pass
    create_engine_mock.assert_not_called()


@patch("kolibri.utils.options.read_options_file")
def test_import_no_options_evaluation(read_options_mock):
    from kolibri.utils import cli  # noqa F401

    read_options_mock.assert_not_called()
