Hyperscript
Hyperscript is a tool for testing HTTP requests with flexible configuration and validation.
Features
- HTTP Methods: Test GET, POST, PUT, and DELETE requests.
- Validation: Check status codes, content types, and body content.
- Conditions: Validate if responses contain specific values, match exact values, or if numeric fields meet criteria (less than, greater than, equal to).
- Concurrency: Run tests in parallel to improve efficiency.
- Reporting: Detailed success and failure messages, with optional verbose output.
Installation
Install with pip:
pip install hyperscript-cli
Configuration
Create a YAML file (config.yaml) for your tests. Example:
global:
url: https://freetestapi.com
run:
- name: Get All Cars
path: /api/v1/cars
expect:
contentType: application/json
status: 200
- name: Get Single Car
path: /api/v1/cars/1
expect:
contentType: application/json
status:
- value: 200
- value: 201
contains:
id: 1
equalTo:
make: Toyota
model: Corolla
lessThan:
price: 30000
greaterThan:
year: 2010
body:
make: Toyota
model: Corolla
color: Silver
Environment Variables
You can use environment variables in your configuration. For example, use {{VARIABLE_NAME}} syntax to reference environment variables.
Set environment variables before running your tests:
export BASE_URL=https://freetestapi.com
export CAR_ID=1
Update config.yaml to use these variables:
global:
url: "{{BASE_URL}}"
run:
- name: Get Single Car
path: /api/v1/cars/{{CAR_ID}}
expect:
contentType: application/json
status:
- value: 200
- value: 201
Usage
Run tests with the hyperscript command:
hyperscript path/to/config.yaml
Command-Line Arguments
-
config_file: Path to the YAML configuration file. Default ishypertest.yml.Example:
hyperscript path/to/config.yaml -
--skip-error: Continue with the next test on error.Example:
hyperscript path/to/config.yaml --skip-error
-
--verbose: Enable detailed logging for more comprehensive output.Example:
hyperscript path/to/config.yaml --verbose
-
--concurrency: Set the number of concurrent tests to run. If not specified, tests will run sequentially.Example:
hyperscript path/to/config.yaml --concurrency 5
Contributing
Fork the repository and submit a pull request with your changes.
License
MIT License. See the LICENSE file.
Contact
For questions, email happer64bit@gmail.com.
Metadata
Release files for hyperscript-cli 1.0.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| hyperscript_cli-1.0.7.tar.gz | 6.4 kB | Without provenance | Details for hyperscript_cli-1.0.7.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| hyperscript_cli-1.0.7-py3-none-any.whl | Python 3 | none | any | Details for hyperscript_cli-1.0.7-py3-none-any.whl |
Total release size: 13.7 kB
Release files / hyperscript_cli-1.0.7.tar.gz
| Download URL | hyperscript_cli-1.0.7.tar.gz |
|---|---|
| Size | 6.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c233c0f136993a3e2c58f61b0bf0983d0e4b984193bf51e7318d85d20ccde79f
|
|
BLAKE2b-256 checksum How to use checksums |
7e57e823b46673e1ce12b8d63a567e98c2f5b25437f46c96262e56193fe79845
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.1.1 CPython/3.12.6
|
Release files / hyperscript_cli-1.0.7-py3-none-any.whl
| Download URL | hyperscript_cli-1.0.7-py3-none-any.whl |
|---|---|
| Size | 7.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0eb1e2928a0b4d2375ddfe5e9bad7385cbb4cf90cfcffe2e2a304599d760a13f
|
|
BLAKE2b-256 checksum How to use checksums |
387e091d1839b90932fbc575effa78860949ff7e375f696eadacad42c7c45164
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.1.1 CPython/3.12.6
|
Security for hyperscript-cli 1.0.7
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.