Skip to main content

GFRAST

GFRAST (GAMS Flexible Repository Assertion Tool) is a small wrapper around the Twill HTTP testing client. It lets you run repeatable, script-driven checks against a web server and summarize the results in a machine-friendly way.

The main difference from using Twill directly is that GFRAST filters and normalizes its output so it can be consumed by other tools or custom clients. The current CLI provides a simple, focused interface for running scripts and writing a JSON summary.

Installation

GFRAST is available on PyPI and can be installed with common package managers:

pip install gfrast
uv add gfrast

If you use uv and only want to run GFRAST temporarily, you can do so without a permanent install:

uvx gfrast --help

Usage

GFRAST executes Twill script files. These are plain text files that describe the HTTP checks to run.

A minimal example script, example.twill, might look like this:

go /foo/bar
   code 200
   find "foobar"

This loads /foo/bar from the configured base URL and asserts that the response has status code 200 and contains the text foobar.

To run a script:

gfrast example.twill

By default, GFRAST uses https://gams.uni-graz.at as the base URL. You can override that with -u / --baseurl:

gfrast -u https://example.com example.twill

You can run multiple scripts by passing several files:

gfrast -u https://example.com example1.twill example2.twill

Or you can point GFRAST to a directory. It will recursively run all .twill files inside that directory:

gfrast -u https://example.com my_scripts

This is especially useful for organizing tests by project or repository section.

Command-line options

The CLI supports the following options:

  • -u, --baseurl <URL>: Set the base URL prepended to each go command.
  • -w, --workers <INTEGER>: Number of worker processes to use. Default is 1.
  • --log-level <STRING>: Set the log level (ERROR, WARNING, INFO, DEBUG).
  • --logfile <PATH>: Path for the JSON summary log file. Default is gfrast.log.json.
  • --no-log: Disable writing the JSON summary file.

Script files

A Twill script is just a plain text file that controls the client.

Example:

go /foo/bar
   code 200
   find "foobar"

The first line (go /foo/bar) issues the request. The base URL is prepended before sending the request. For example, with --baseurl https://example.com, this becomes:

https://example.com/foo/bar

The next line (code 200) asserts that the response status is 200.

The third line (find "foobar") asserts that the response body contains the string foobar.

For more advanced behavior, Twill supports a wide range of commands for forms, cookies, redirects, and more. See the official Twill docs: https://twill.readthedocs.io/en/latest/commands.html

Frequently used script commands

go <PATH>

This is usually the first command in a script. Most other commands operate on the result of the last go request.

go /foo/bar
   code 200
   find "foobar"

When the base URL is set, go values are automatically expanded to full URLs.

code <INT>

Asserts that the response status matches the given integer.

code 200

find <PATTERN> [<FLAGS>]

Checks whether the response contains the given pattern.

find "foo"

This supports regular expressions and flags such as i (ignore case) and m (multiline). It can also be used with XPath via the x flag.

Example:

find "//xhtml:input/@id[.='query']" x

not_find

Asserts that a pattern does not appear in the response.

url <PATTERN>

Asserts that the current page URL matches a given pattern. This is especially useful for redirect tests.

title <PATTERN>

Asserts that the page title matches the supplied pattern.

header <NAME>[<PATTERN>]

Checks that an HTTP header has the expected value.

echo

Prints a string to the output stream.

info

Displays information about the current page for debugging.

show

Prints the current page content for debugging.

Development

The git.uni-graz.at server is only a mirror for the private repository, where the development takes place.

Metadata

Release files for gfrast 0.3.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gfrast 0.3.2
File Size Uploaded Provenance Actions
gfrast-0.3.2.tar.gz 10.1 kB Without provenance Details for gfrast-0.3.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for gfrast 0.3.2
File Interpreter ABI Platform Actions
gfrast-0.3.2-py3-none-any.whl Python 3 none any Details for gfrast-0.3.2-py3-none-any.whl

Total release size: 21.0 kB

Release files / gfrast-0.3.2.tar.gz

Download URL gfrast-0.3.2.tar.gz
Size 10.1 kB
Tags Source
SHA-256 checksum
How to use checksums
9deea57d3681e0b0b37e0a5a6bd6bee2fa2a28751101cb29d8145d831de016e2
BLAKE2b-256 checksum
How to use checksums
42096285806abcb86c5dcc320c40ccd9c96a42d39a21a2ea8ff1df49b2c6e7a3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / gfrast-0.3.2-py3-none-any.whl

Download URL gfrast-0.3.2-py3-none-any.whl
Size 10.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b1501bfbdf2a238c8a1ff1fb376151b0cb217b793648f443aaf0fd0c97071adb
BLAKE2b-256 checksum
How to use checksums
ee45d2fffe238aa30777c21a99765fde5e5d0eb6e63917ee3a28a6b613e33bce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for gfrast 0.3.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page