Skip to content

Commit

Permalink
Simplify code.
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyandrewmeyer committed Aug 7, 2024
1 parent 02d59be commit 4221b02
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions scenario/mocking.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,19 +88,16 @@ def __init__(
# You can't pass *in* the stdin, the charm is responsible for that.
self.stdin = StringIO()

def _store_stdin(self):
self._exec._update_stdin(self.stdin.getvalue())

def wait(self):
self._waited = True
self._store_stdin()
self._exec._update_stdin(self.stdin.getvalue())
exit_code = self._exec.return_code
if exit_code != 0:
raise ExecError(list(self._command), exit_code, None, None)

def wait_output(self):
exec = self._exec
self._store_stdin()
self._exec._update_stdin(self.stdin.getvalue())
exit_code = exec.return_code
if exit_code != 0:
raise ExecError(
Expand Down

0 comments on commit 4221b02

Please sign in to comment.