Exemplo n.º 1
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()
Exemplo n.º 2
0
    def test_prepare_passing_suite_verbose_0(self, mock_suite, mock_prepare_feature,
                                             mock_prepare_border, mock_prepare_statistics,
                                             mock_cyan, mock_red):

        display = Display()
        display.verbosity_level = 0

        mock_suite.passed = True

        display.prepare_suite(mock_suite)

        display.prepare_border.assert_called_with(mock_cyan, 150)
        display.prepare_feature.assert_not_called()
        display.prepare_statistics.assert_called_with(mock_suite)
        self.assertEqual(display.display_string, "="*150 + "\n" + "="*150 + "\n")
Exemplo n.º 3
0
    def test_prepare_failing_suite_verbose_0(self, mock_suite, mock_prepare_feature,
                                             mock_prepare_border, mock_prepare_statistics,
                                             mock_cyan, mock_red):

        display = Display()
        display.verbosity_level = 0

        mock_suite.passed = False
        mock_suite.features = ['feature_one', 'feature_two']

        display.prepare_suite(mock_suite)

        display.prepare_border.assert_called_with(mock_red, 150)
        display.prepare_feature.assert_any_call('feature_one')
        display.prepare_feature.assert_any_call('feature_two')
        display.prepare_statistics.assert_called_with(mock_suite)
        self.assertEqual(display.display_string, "="*150 + "\n" + "="*150 + "\n")