Language-independent conformance test suite for multipart/form-data parsing and generation
Project description
Multipart Form-Data Conformance Test Suite
⚠️ EARLY ALPHA - DO NOT USE
This test suite is in very early development and has not been verified against real-world implementations. The test cases, expected results, and tooling may contain errors. Do not rely on this for validating parser conformance until it has been thoroughly reviewed and tested.
A language-independent test suite for validating HTTP multipart/form-data parsers and generators.
Goals
- Language-independent - Raw binary test files with JSON metadata
- Bidirectional - Test both parsing and generation
- Comprehensive - Cover spec requirements, edge cases, and browser variations
- Self-describing - Each test case explains what it's testing
Quick Start
Running Tests Against Your Implementation
- Iterate through test directories in
tests/ - For each test:
- Read
headers.jsonto get the Content-Type header with boundary - Read
input.rawas binary data (the HTTP request body) - Parse using your implementation
- Compare results against
expectedintest.json
- Read
Test Case Structure
Each test case is a directory containing:
tests/category/NNN-test-name/
├── test.json # Metadata and expected results
├── headers.json # HTTP headers (Content-Type with boundary)
└── input.raw # Raw HTTP body bytes (binary)
Test Categories
| Category | ID Range | Description |
|---|---|---|
| basic | 001-019 | Essential parsing tests |
| filenames | 020-039 | Filename parameter handling |
| boundaries | 040-059 | Boundary detection and edge cases |
| line-endings | 060-079 | CRLF/LF handling |
| content-types | 080-099 | Content-Type and header parsing |
| edge-cases | 100-199 | Unusual but valid scenarios |
| malformed | 200-299 | Invalid input error handling |
| browser-variations | 300-399 | Real browser output patterns |
File Formats
test.json
{
"id": "001-single-text-field",
"name": "Single text field",
"description": "Basic test with one text form field",
"spec_references": ["RFC 7578 Section 4.2"],
"category": "basic",
"tags": ["required", "parsing"],
"expected": {
"valid": true,
"parts": [
{
"name": "username",
"filename": null,
"content_type": null,
"body_text": "john_doe"
}
]
}
}
headers.json
{
"content-type": "multipart/form-data; boundary=----TestBoundary123"
}
input.raw
Binary file containing exact HTTP body bytes. Use a hex editor or the provided tools to inspect.
Tools
tools/generate-raw.py- Create .raw files programmaticallytools/validate-suite.py- Validate test suite integritytools/run-reference.py- Reference parser implementation
Spec References
- RFC 7578 - Returning Values from Forms: multipart/form-data
- RFC 2046 - MIME Part Two: Media Types (multipart definition)
- RFC 5987 - Character Set and Language Encoding (filename*)
- HTML Living Standard - Form submission
License
This test suite is released under the MIT License. See LICENSE for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file multipart_form_data_conformance-0.1a0.tar.gz.
File metadata
- Download URL: multipart_form_data_conformance-0.1a0.tar.gz
- Upload date:
- Size: 19.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
60d06e38cedd7dbf272ca84742d9b9428da5e7fdebb9b75ee41b1a043d5e2824
|
|
| MD5 |
40dbdcf7f1c0f52902ba19ccad2dc57d
|
|
| BLAKE2b-256 |
606534b50d307b2f764553b1961945c89e6baff9e35c14b2687d3c08f4b65980
|
Provenance
The following attestation bundles were made for multipart_form_data_conformance-0.1a0.tar.gz:
Publisher:
publish.yml on simonw/multipart-form-data-conformance
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
multipart_form_data_conformance-0.1a0.tar.gz -
Subject digest:
60d06e38cedd7dbf272ca84742d9b9428da5e7fdebb9b75ee41b1a043d5e2824 - Sigstore transparency entry: 844534994
- Sigstore integration time:
-
Permalink:
simonw/multipart-form-data-conformance@daa3d8de29d778bf13770c49d4291e6055f06d0d -
Branch / Tag:
refs/tags/0.1a0 - Owner: https://github.com/simonw
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@daa3d8de29d778bf13770c49d4291e6055f06d0d -
Trigger Event:
release
-
Statement type:
File details
Details for the file multipart_form_data_conformance-0.1a0-py3-none-any.whl.
File metadata
- Download URL: multipart_form_data_conformance-0.1a0-py3-none-any.whl
- Upload date:
- Size: 85.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9250810800cb227da5bd4ae0a61cd7d92595f92968125dec3ee7c97b6cc37029
|
|
| MD5 |
c4b380e9428b381eadb6352b95f66fdc
|
|
| BLAKE2b-256 |
3f186cb98310b7cb1f12843b54cbf639f96cc39c10ceec0f13a36de83e62c572
|
Provenance
The following attestation bundles were made for multipart_form_data_conformance-0.1a0-py3-none-any.whl:
Publisher:
publish.yml on simonw/multipart-form-data-conformance
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
multipart_form_data_conformance-0.1a0-py3-none-any.whl -
Subject digest:
9250810800cb227da5bd4ae0a61cd7d92595f92968125dec3ee7c97b6cc37029 - Sigstore transparency entry: 844534995
- Sigstore integration time:
-
Permalink:
simonw/multipart-form-data-conformance@daa3d8de29d778bf13770c49d4291e6055f06d0d -
Branch / Tag:
refs/tags/0.1a0 - Owner: https://github.com/simonw
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@daa3d8de29d778bf13770c49d4291e6055f06d0d -
Trigger Event:
release
-
Statement type: