Example #1
0
 def run_command(self, code, **kw):
     with TempDirectory() as dir:
         self.path = dir.write('test.py', code+'\n')
         with OutputCapture() as output:
             result = run([sys.executable, self.path], **kw)
         output.compare('')
     return result
Example #2
0
 def process(self, path):
     output = run(['crontab', '-l', '-u', self.name])
     with open(join(path, self.name), 'w') as stream:
         stream.write(output)
Example #3
0
 def test_with_shell(self):
     with OutputCapture() as output:
         result = run('echo "hello out there"', shell=True)
     output.compare('')
     compare(result, 'hello out there\n')
Example #4
0
 def process(self, path):
     output = run([self.name, package_managers[self.name]])
     with open(join(path, self.name), 'w') as stream:
         stream.write(output)
Example #5
0
 def run_git(self, *args):
     return run((self.git, )+args, cwd=self.path)
Example #6
0
 def git(self, command, repo_path=None):
     return run(["git"] + command.split(), cwd=repo_path or self.dir.path)