Latest Version: 0.9.6.2

fixture

Routines for testing WSGI applications.

Most interesting is the TestApp for testing WSGI applications, and the TestFileEnvironment class for testing the effects of command-line scripts.


Functions

f html_unquote(v) ...

Unquote (some) entities in HTML. (incomplete)

f setup_module(module=None) ...

This is used by py.test if it is in the module, so you can import this directly.

Use like:

from paste.tests.fixture import setup_module

f sorted(l) ...

f tempnam_no_warning(*args) ...

An os.tempnam with the warning turned off, because sometimes you just need to use this and don't care about the stupid security warning.

Classes

C AppError(...) ...

This class contains 2 members.

C CaptureStdout(...) ...

This class contains 5 members.

C Checkbox(...) ...

Field representing <input type="checkbox">

This class contains 7 members.

C Dummy_smtplib(...) ...

This class contains 6 members.

C Field(...) ...

Field object.

This class contains 7 members.

C Form(...) ...

This object represents a form that has been found in a page. This has a couple useful attributes:

text:
the full HTML of the form.
action:
the relative URI of the action.
method:
the method (e.g., 'GET').
id:
the id, or None if not given.
fields:
a dictionary of fields, each value is a list of fields by that name. <input type="radio"> and <select> are both represented as single fields with multiple options.

This class contains 8 members.

C FoundDir(...) ...

Represents a directory created by a command.

This class contains 3 members.

C FoundFile(...) ...

Represents a single file found as the result of a command.

Has attributes:

path:
The path of the file, relative to the base_path
full:
The full path
stat:
The results of os.stat. Also mtime and size contain the .st_mtime and st_size of the stat.
bytes:
The contents of the file.

You may use the in operator with these objects (tested against the contents of the file), and the .mustcontain() method.

This class contains 7 members.

C Hidden(...) ...

Field representing <input type="hidden">

This class contains 7 members.

C NoDefault(...) ...

This class contains 1 member.

C ProcResult(...) ...

Represents the results of running a command in TestFileEnvironment.

Attributes to pay particular attention to:

stdout, stderr:
What is produced
files_created, files_deleted, files_updated:
Dictionaries mapping filenames (relative to the base_dir) to FoundFile or FoundDir objects.

This class contains 3 members.

C Radio(...) ...

Field representing <input type="radio">

This class contains 7 members.

C Select(...) ...

Field representing <select>

This class contains 7 members.

C Submit(...) ...

Field representing <input type="submit"> and <button>

This class contains 8 members.

C TestApp(...) ...

This class contains 9 members.

C TestFileEnvironment(...) ...

This represents an environment in which files will be written, and scripts will be run.

This class contains 5 members.

C TestRequest(...) ...

This class contains 2 members.

C TestResponse(...) ...

This class contains 17 members.

C Text(...) ...

Field representing <input type="text">

This class contains 7 members.

C Textarea(...) ...

Field representing <textarea>

This class contains 7 members.

See the source for more information.

Top