pytest-cid
Compare data structures containing matching CIDs of different versions and encodings
A simple wrapper around py-cid for easily writing tests
involving CIDs in datastructures.
Table of Contents
Install
Install with pip:
pip install pytest-cid
Usage
Basic usage example:
>>> import pytest_cid
>>> cid_1 = "zb2rhfE3SX3q7Ha6UErfMqQReKsmLn73BvdDRagHDM6X1eRFN"
>>> cid_2 = "bafkreid7qoywk77r7rj3slobqfekdvs57qwuwh5d2z3sqsw52iabe3mqne"
>>> assert pytest_cid.match(cid_1) == cid_2
>>> assert pytest_cid.normalize(cid_1) == pytest_cid.normalize(cid_2)
>>> cid_struct_1 = {
... "Hash": "QmQcCtMgLVwvMQGu6mvsRYLjwqrZJcYtH4mboM9urWW9vX",
... "Name": "fsdfgh", "Size": "16"
... }
>>> cid_struct_2 = {
... "Hash": "f0170122021b377e527deaa9698a451fa07232d7cd9494f6553252f325559d9053b565b38",
... "Name": "fsdfgh", "Size": "16"
... }
>>> assert pytest_cid.match(cid_struct_1) == cid_struct_2
>>> assert pytest_cid.match(cid_struct_1) != cid_1
Documentation
FIXME (Usage example covers the whole API as of 1.0.0)
Contribute
IRC/Matrix
Join us on Matrix or on IRC on #py-ipfs on chat.freenode.org if you have any suggestions, questions or just want to chat about IPFS and/or Python with us.
- Please note however that, at the time of writing, the default
matrix.orgserver is severely overloaded and your messages may only arrive with extreme delay; using a different homeserver is hence highly recommended.
Bug reports
You can submit bug reports using the GitHub issue tracker.
Pull requests
Pull requests are welcome. Before submitting a new pull request, please make sure that your code passes both the code formatting check:
$ tox -e styleck
And the unit tests:
$ tox
Please make sure to include new unit tests for new features or changes in behavior.
License
Distributed under the terms of the Mozilla Public License 2.0 license, “pytest-cid” is free and open source software. Details may be found in the LICENSE file in this repository.
Release files for pytest_cid 1.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pytest_cid-1.1.2.tar.gz | 18.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pytest_cid-1.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 27.5 kB
Release files / pytest_cid-1.1.2.tar.gz
| Download URL | pytest_cid-1.1.2.tar.gz |
|---|---|
| Size | 18.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3d6fcfe0c9ce4cc3935952b824091e109aa99f98068dd8cf27d0067914681feb
|
|
BLAKE2b-256 checksum How to use checksums |
dd5eaaabc867bd13f1a8983a7eea2957f48aa47eab5d5d8259a82206c7fe38b8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.31.0
|
Release files / pytest_cid-1.1.2-py3-none-any.whl
| Download URL | pytest_cid-1.1.2-py3-none-any.whl |
|---|---|
| Size | 9.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e798a5c5930b06b5788d001dcbadad7d14d593f047f9c576b94f049289cbe677
|
|
BLAKE2b-256 checksum How to use checksums |
e456da9e2bb9b64a94b1afb7d3a8581327c58aef72bf14dc7de6c110b62f2eaf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.31.0
|