コード例 #1
0
ファイル: test_helpers.py プロジェクト: Simplistix/archivist
 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
コード例 #2
0
ファイル: crontab.py プロジェクト: Simplistix/archivist
 def process(self, path):
     output = run(['crontab', '-l', '-u', self.name])
     with open(join(path, self.name), 'w') as stream:
         stream.write(output)
コード例 #3
0
ファイル: test_helpers.py プロジェクト: Simplistix/archivist
 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')
コード例 #4
0
ファイル: packages.py プロジェクト: Simplistix/archivist
 def process(self, path):
     output = run([self.name, package_managers[self.name]])
     with open(join(path, self.name), 'w') as stream:
         stream.write(output)
コード例 #5
0
ファイル: git.py プロジェクト: Simplistix/archivist
 def run_git(self, *args):
     return run((self.git, )+args, cwd=self.path)
コード例 #6
0
ファイル: test_repo_git.py プロジェクト: Simplistix/archivist
 def git(self, command, repo_path=None):
     return run(["git"] + command.split(), cwd=repo_path or self.dir.path)