def test_executable(self): exe = yield from rule.make_files_executable(self.cache, self.content_tree, ["b/*"]) new_content_dir = shared.create_dir() yield from self.cache.export_tree(exe, new_content_dir) shared.assert_contents(new_content_dir, self.content) shared.assert_not_executable(os.path.join(new_content_dir, "a")) shared.assert_executable(os.path.join(new_content_dir, "b/c"))
async def test_executable(self): exe = await rule.make_files_executable(self.cache, self.content_tree, ['b/*']) new_content_dir = shared.create_dir() await self.cache.export_tree(exe, new_content_dir) shared.assert_contents(new_content_dir, self.content) shared.assert_not_executable(os.path.join(new_content_dir, 'a')) shared.assert_executable(os.path.join(new_content_dir, 'b/c'))
def test_executable(self): exe = rule.make_files_executable(self.cache, self.content_tree, ['b/*']) new_content_dir = shared.create_dir() self.cache.export_tree(exe, new_content_dir) shared.assert_contents(new_content_dir, self.content) shared.assert_not_executable(os.path.join(new_content_dir, 'a')) shared.assert_executable(os.path.join(new_content_dir, 'b/c'))
def test_unpack_windows_zip(self): '''This zip was packed on Windows, so it doesn't include any file permissions. This checks that our executable-flag-restoring code doesn't barf when the flag isn't there.''' test_dir = shared.create_dir() archive = shared.test_resources / 'from_windows.zip' curl_plugin.extract_zip(str(archive), test_dir) shared.assert_contents(test_dir, {'windows_test/test.txt': 'Notepad!'}) txt_file = join(test_dir, 'windows_test/test.txt') shared.assert_not_executable(txt_file)
def test_curl_plugin_fetch_archives(self): for type in 'zip', 'tar': fields = { 'url': (shared.test_resources / ('with_exe.' + type)).as_uri(), 'unpack': type, } fetch_dir = shared.create_dir() self.do_plugin_test('curl', fields, { 'not_exe.txt': 'Not executable.\n', 'exe.sh': 'echo Executable.\n', }, fetch_dir=fetch_dir) shared.assert_not_executable( os.path.join(fetch_dir, 'not_exe.txt')) shared.assert_executable(os.path.join(fetch_dir, 'exe.sh'))