def generate_script(self, expected_file, is_online):
        try:
            self.bdist.online_install = is_online

            os.chdir(packaging_dir)
            try:
                os.mkdir('build')
            except __HOLE__ as exception:
                if exception.errno != errno.EEXIST:
                    raise

            self.bdist.generate_install_script('wheel_name', 'build')

            actual_install_script = open('build/install-prestoadmin.sh').read()

            file_dir = os.path.abspath(os.path.dirname(__file__))
            template = os.path.join(file_dir,
                                    'resources',
                                    expected_file)
            expected_install_script = open(template).read()

            self.assertEqual(expected_install_script, actual_install_script)
        finally:
            remove_tree('build')
dataset/ETHPy150Open prestodb/presto-admin/tests/unit/test_bdist_prestoadmin.py/TestBDistPrestoAdmin.generate_script