websauna.tests.cookiecutter.scaffold module¶
Scaffold test utility functions.
py.test fixture to create app scaffold.
Create application and virtualenv for it. Run setup.py.
- Return type
- Returns
Path to a temporary folder. In this folder there is venv folder and myapp folder.
py.test fixture to generate a tmp config file for cookiecutter.
- Return type
- Returns
Path to cookiecutter config file.
py.test fixture to createdb and destroy postgresql database on demand.
Run a command in a specific folder.
Run a command in a specific folder using virtualenv created there.
Assume virtualenv is under
venv
folder.- Parameters
cwd – Base folder.
timeout – Command timeout.
wait_and_see – Wait this many seconds to see if app starts up.
assert_exit – Assume exit code is this
cd_folder – cd to this folder before executing the command (relative to folder)
- Returns
tuple (exit code, stdout, stderr)
Add piece to text to a text file after a line having a marker string on it.
Speed up tests by loading Python packages from primed cache.
Use
create_wheelhouse.bash
to prime the cache.- Parameters
folder (
str
) – Temporary virtualenv installation
A context manager to temporary swap the content of a file.
Simulate starting ws-pserve command from the command line inside the virtualenv.