Util Testing Consoletest Commands

Running of shell commands

class dffml.util.testing.consoletest.commands.ActivateVirtualEnvCommand(directory: str)[source]
class dffml.util.testing.consoletest.commands.CDCommand(directory: str)[source]
class dffml.util.testing.consoletest.commands.ConsoleCommand(cmd: List[str])[source]
class dffml.util.testing.consoletest.commands.ConsoletestCommand[source]
class dffml.util.testing.consoletest.commands.CreateVirtualEnvCommand(directory: str)[source]
class dffml.util.testing.consoletest.commands.DockerRunCommand(cmd: List[str])[source]
static find_name(cmd)[source]

Find the name of the container we are starting (if starting as daemon)

exception dffml.util.testing.consoletest.commands.HTTPServerCMDDoesNotHavePortFlag[source]
class dffml.util.testing.consoletest.commands.NPMInstallCommand(cmd: List[str])[source]
exception dffml.util.testing.consoletest.commands.OutputComparisionError[source]

Raised when the output of a command was incorrect

class dffml.util.testing.consoletest.commands.PipInstallCommand(cmd: List[str])[source]
fix_dffml_packages(ctx)[source]

If a piece of the documentation says to install dffml or one of the packages, we need to make sure that the version from the current branch gets installed instead, since we don’t want to test the released version, we want to test the version of the codebase as it is.

exception dffml.util.testing.consoletest.commands.PipNotRunAsModule[source]

Raised when a pip install command was not prefixed with python -m to run pip as a module. Pip sometimes complains when this is not done.

class dffml.util.testing.consoletest.commands.SimpleHTTPServerCommand(*args, **kwargs)[source]
class dffml.util.testing.consoletest.commands.YarnInstallCommand(cmd: List[str])[source]
dffml.util.testing.consoletest.commands.buf_to_fileobj(buf: Union[str, bytes])[source]

Given a buffer, create a temporary file and write the contents of the string of bytes buffer to the file. Seek to the beginning of the file. Yield the file object.

dffml.util.testing.consoletest.commands.tmpenv(cmd: List[str]) List[str][source]

Handle temporary environment variables prepended to command