def test_find_script_files_normal_shebang(bin_dir): d = Deployment('testing') d.bin_dir = bin_dir script_files = [os.path.join(bin_dir, s) for s in ('s1', 's2', 's3')] for script in script_files: with open(os.path.join(bin_dir, script), 'w') as f: f.write('#!/usr/bin/python\n') with open(os.path.join(bin_dir, 'n1'), 'w') as f: f.write('#!/bin/bash') found_files = sorted(d.find_script_files()) eq_(found_files, script_files)
def test_find_script_files_long_shebang(bin_dir): d = Deployment('testing') d.bin_dir = bin_dir script_files = [os.path.join(bin_dir, s) for s in ('s1', 's2', 's3')] for script in script_files: with open(os.path.join(bin_dir, script), 'w') as f: # It does not really matter what we write into the # exec statement as executable here f.write(create_new_style_shebang('/usr/bin/python')) with open(os.path.join(bin_dir, 'n1'), 'w') as f: f.write('#!/bin/bash') found_files = sorted(d.find_script_files()) eq_(found_files, script_files)
def test_find_script_files_long_shebang(bin_dir): d = Deployment('testing') d.bin_dir = bin_dir script_files = [os.path.join(bin_dir, s) for s in ('s1', 's2', 's3')] for script in script_files: with open(os.path.join(bin_dir, script), 'w') as f: # It does not really matter what we write into the # exec statement as executable here f.write( create_new_style_shebang('/usr/bin/python')) with open(os.path.join(bin_dir, 'n1'), 'w') as f: f.write('#!/bin/bash') found_files = sorted(d.find_script_files()) eq_(found_files, script_files)