Ejemplo n.º 1
0
 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"))
Ejemplo n.º 2
0
 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'))
Ejemplo n.º 3
0
 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'))
Ejemplo n.º 4
0
 def test_rule_with_executable(self):
     contents = {'a.txt': '', 'b.txt': '', 'c.foo': ''}
     module_dir = shared.create_dir(contents)
     self.write_yaml('''\
         cp module foo:
             path: {}
             executable: "*.txt"
         imports:
             foo: ./
         ''', module_dir)
     self.do_integration_test(['sync'], contents)
     for f in ('a.txt', 'b.txt'):
         shared.assert_executable(os.path.join(self.test_dir, f))
Ejemplo n.º 5
0
 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'))
Ejemplo n.º 6
0
 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'))
Ejemplo n.º 7
0
 def test_rule_with_executable(self):
     contents = {'a.txt': '', 'b.txt': '', 'c.foo': ''}
     module_dir = shared.create_dir(contents)
     self.write_yaml(
         '''\
         cp module foo:
             path: {}
             executable: "*.txt"
         imports:
             foo: ./
         ''', module_dir)
     self.do_integration_test(['sync'], contents)
     for f in ('a.txt', 'b.txt'):
         shared.assert_executable(os.path.join(self.test_dir, f))