# Path: jasper/entrypoints.py
# @click.command()
# @click.argument('test_directory', type=click.Path(exists=True, file_okay=False, dir_okay=True, resolve_path=True))
# @click.option('--ansi', is_flag=True, default=False, help="Flag to force display to use ansi escape sequences for coloring.")
# @click.option('-v', type=click.IntRange(0, 2), default=0, help="Verbosity level from 0 to 2. default is 0.")
# def jasper(test_directory, ansi, v):
#     """
#     The entrypoint of the application.
# 
#     Runs Jasper tests within a given directory and displays the results.
# 
#     :param test_directory: The directory containing feature files to run.
#     :param ansi: A flag for whether or not to force ansi escape sequences in the display for coloring purposes.
#     :param v: A verbosity level for the display. Ranges from 0 to 2.
#     """
#     runner = Runner(test_directory)
#     completed_suite = runner.run()
#     display = Display(force_ansi=ansi, verbosity_level=v)
#     display.prepare_suite(completed_suite)
#     display.display()


from unittest import TestCase, mock
from click.testing import CliRunner
from jasper.entrypoints import jasper
import os


class JasperTestCase(TestCase):

    def setUp(self):
        self.test_directory = os.path.abspath('.\mock_features')

    @mock.patch('jasper.entrypoints.Display')
    @mock.patch('jasper.entrypoints.Runner')
    def test_jasper_without_options(self, mock_runner_class, mock_display_class):
        mock_runner = mock.MagicMock()
        mock_runner.run.return_value = 'foobar'
        mock_runner_class.return_value = mock_runner

        mock_display = mock.MagicMock()
        mock_display_class.return_value = mock_display

        click_runner = CliRunner()

# Path: jasper/entrypoints.py
# @click.command()
# @click.argument('test_directory', type=click.Path(exists=True, file_okay=False, dir_okay=True, resolve_path=True))
# @click.option('--ansi', is_flag=True, default=False, help="Flag to force display to use ansi escape sequences for coloring.")
# @click.option('-v', type=click.IntRange(0, 2), default=0, help="Verbosity level from 0 to 2. default is 0.")
# def jasper(test_directory, ansi, v):
#     """
#     The entrypoint of the application.
# 
#     Runs Jasper tests within a given directory and displays the results.
# 
#     :param test_directory: The directory containing feature files to run.
#     :param ansi: A flag for whether or not to force ansi escape sequences in the display for coloring purposes.
#     :param v: A verbosity level for the display. Ranges from 0 to 2.
#     """
#     runner = Runner(test_directory)
#     completed_suite = runner.run()
#     display = Display(force_ansi=ansi, verbosity_level=v)
#     display.prepare_suite(completed_suite)
#     display.display()


# Path: tests/test_unit/test_entrypoints.py
from unittest import TestCase, mock
from click.testing import CliRunner
from jasper.entrypoints import jasper
import os



class JasperTestCase(TestCase):

    def setUp(self):
        self.test_directory = os.path.abspath('.\mock_features')

    @mock.patch('jasper.entrypoints.Display')
    @mock.patch('jasper.entrypoints.Runner')
    def test_jasper_without_options(self, mock_runner_class, mock_display_class):
        mock_runner = mock.MagicMock()
        mock_runner.run.return_value = 'foobar'
        mock_runner_class.return_value = mock_runner

        mock_display = mock.MagicMock()
        mock_display_class.return_value = mock_display

        click_runner = CliRunner()

        result = click_runner.invoke(jasper, [self.test_directory])