def test_prepare_failing_statistics(self, mock_suite, mock_cyan, mock_red): display = Display() mock_suite.passed = False mock_suite.num_features_passed = 4 mock_suite.num_features_failed = 1 mock_suite.num_scenarios_passed = 15 mock_suite.num_scenarios_failed = 5 display.prepare_statistics(mock_suite) display.cyan.assert_not_called() display.red.assert_called_once_with( "4 Features passed, 1 failed.\n" "15 Scenarios passed, 5 failed." ) self.assertEqual( display.display_string, "4 Features passed, 1 failed.\n15 Scenarios passed, 5 failed.\n" )
def test_prepare_passing_statistics(self, mock_suite, mock_cyan, mock_red): display = Display() mock_suite.passed = True mock_suite.num_features_passed = 5 mock_suite.num_features_failed = 0 mock_suite.num_scenarios_passed = 20 mock_suite.num_scenarios_failed = 0 display.prepare_statistics(mock_suite) display.red.assert_not_called() display.cyan.assert_called_once_with( "5 Features passed, 0 failed.\n" "20 Scenarios passed, 0 failed." ) self.assertEqual( display.display_string, "5 Features passed, 0 failed.\n20 Scenarios passed, 0 failed.\n" )