def test_run_command_error(dest): options = flexmock( bin_dir=None, source=None, dest=dest) with pytest.raises(Exception): link.run_command(options)
def test_run_command(tmpdir): options = flexmock( bin_dir=tmpdir.strpath, dest='an_exe', source='/bin/egg') link.run_command(options) dest = tmpdir.join('an_exe') assert dest.exists() mode = os.stat(dest.strpath).st_mode & 0o777 assert mode == 0o755 binary = dest.read_binary() assert b'exec $CLEAN_ENV/.env/bin/inenv -- /bin/egg $@' in binary