testutil/dott: add a note about endless output

Summary:
The `output` API is the thing that stops infinite output from being used.

If endless output is needed, it can be expressed using something like Python
generator. Then the callsites using `stdin` needs update as well.

Reviewed By: xavierd

Differential Revision: D16464660

fbshipit-source-id: 1b81c44c5089f03687aa63ed3ffda9a5399c199b
This commit is contained in:
Jun Wu 2019-07-24 14:15:16 -07:00 committed by Facebook Github Bot
parent 2b63b9480e
commit 60cf7203a4

View File

@ -29,7 +29,11 @@ class LazyCommand(object):
@property
def output(self):
"""Emulate the command. Return its output."""
"""Emulate the command. Return its output.
Currently the output is a string. i.e. infinite stream (ex. `yes` from
coreutils) cannot be expressed using this API.
"""
if self._output is None:
if isinstance(self._command, str):
args = shlex.split(self._command)