def test_main_runs_entire_directory_of_specs(self): with patch('pyspec.suite') as suite_handler: suite_handler.out = Mock() sys.argv = ['pyspec', 'tests/examples'] runner.main() self.assertTrue(suite_handler.report_success.called) self.assertTrue(suite_handler.report_failure.called) self.assertTrue(suite_handler.report_error.called)
def test_main_returns_1_for_non_existent_test_suite(self): with patch('pyspec.suite.out'): sys.argv = ['pyspec', 'tests/examples/non_existent_spec.py'] self.assertEqual(1, runner.main())
def test_main_returns_0_for_green_test_suite(self): with patch('pyspec.suite.out'): sys.argv = ['pyspec', 'tests/examples/green_spec.py'] self.assertEqual(0, runner.main())