Beispiel #1
0
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')
Beispiel #2
0
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')
Beispiel #3
0
def test_main_args_none(mock_sys):
    with pytest.raises(AttributeError):
        main(['pakit_tests'])
    mock_sys.exit.assert_called_with(2)