def test_main_output_absolutel(mock_write, mock_print): main(['pakit_tests', '.', '/dev/null']) mock_print.assert_any_call('Scanning recipes under: ' + os.getcwd()) mock_print.assert_any_call('Writing tests to: /dev/null')
def test_main_output_relative(mock_write, mock_print): main(['pakit_tests', '/tmp']) mock_print.assert_any_call('Scanning recipes under: /tmp') mock_print.assert_any_call('Writing tests to: /tmp/tests/test_recipes.py') mock_write.assert_any_call('/tmp', '/tmp/tests/test_recipes.py')
def test_main_args_none(mock_sys): with pytest.raises(AttributeError): main(['pakit_tests']) mock_sys.exit.assert_called_with(2)