Lines Matching refs:self
43 def __init__(self, name: str, env: Env, run_dir: Optional[str] = None, argument
46 self.name = name
47 self.path = os.path.join(env.build_dir, f'tests/http/clients/{name}')
48 self.env = env
49 self._run_env = run_env
50 self._timeout = timeout if timeout else env.test_timeout
51 self._curl = os.environ['CURL'] if 'CURL' in os.environ else env.curl
52 self._run_dir = run_dir if run_dir else os.path.join(env.gen_dir, name)
53 self._stdoutfile = f'{self._run_dir}/stdout'
54 self._stderrfile = f'{self._run_dir}/stderr'
55 self._rmrf(self._run_dir)
56 self._mkpath(self._run_dir)
59 def run_dir(self) -> str: argument
60 return self._run_dir
63 def stderr_file(self) -> str: argument
64 return self._stderrfile
66 def exists(self) -> bool: argument
67 return os.path.exists(self.path)
69 def download_file(self, i: int) -> str: argument
70 return os.path.join(self._run_dir, f'download_{i}.data')
72 def _rmf(self, path): argument
76 def _rmrf(self, path): argument
80 def _mkpath(self, path): argument
84 def run(self, args): argument
85 self._rmf(self._stdoutfile)
86 self._rmf(self._stderrfile)
89 myargs = [self.path]
92 if self._run_env:
93 run_env = self._run_env.copy()
98 with open(self._stdoutfile, 'w') as cout, open(self._stderrfile, 'w') as cerr:
100 cwd=self._run_dir, shell=False,
102 timeout=self._timeout)
108 coutput = open(self._stdoutfile).readlines()
109 cerrput = open(self._stderrfile).readlines()
114 def dump_logs(self): argument
117 lines.extend(open(self._stdoutfile).readlines())
119 lines.extend(open(self._stderrfile).readlines())