cykooz.testing
cykooz.testing is collection of helper utilities for testing.
Utilities
Dict
A dict object that can be compared with other dict object without regard to keys that did not presents in the Dict instance.
>>> from cykooz.testing import Dict
>>> d1 = Dict(a=1, b='foo')
>>> d2 = {'a': 1, 'b': 'foo', 'c': True}
>>> d1 == d2
True
>>> d2 == d1
True
>>> d1 != d2
False
>>> d3 = {'a': 1, 'c': True}
>>> d1 == d3
False
>>> d3 == d1
False
>>> d1 != d3
True
>>> Dict({'a': 1})
Dict({'a': 1})
Short alias:
>>> from cykooz.testing import D
>>> {'a': 1, 'b': 'foo'} == D({'a': 1})
True
List
A list object that can be compared with other list object without regard to extra items contains in the other list object.
>>> from cykooz.testing import List
>>> l1 = List([1, 'foo'])
>>> l2 = [1, 'foo', True]
>>> l1 == l2
True
>>> l2 == l1
True
>>> l1 != l2
False
>>> l3 = [1, True]
>>> l1 == l3
False
>>> l3 == l1
False
>>> l1 != l3
True
>>> l1 == [1]
False
>>> List([1, 'foo', True])
List([1, 'foo', True])
>>> List([Dict(), Dict()]) == [{'a': 1}, {'b': 2}]
True
Short alias:
>>> from cykooz.testing import L
>>> [1, 'foo', True] == L([1, 'foo'])
True
AnyValue
Instance of this class is equal to any other values.
>>> from cykooz.testing import AnyValue
>>> v = AnyValue()
>>> v == 1
True
>>> 1 == v
True
>>> v != 1
False
>>> v == {'a': 1, 'b': 'foo'}
True
>>> v == [1, 2, 3, 'b']
True
>>> v == AnyValue()
True
>>> v
<any value>
>>> {v: 1}
Traceback (most recent call last):
...
TypeError: unhashable type: 'AnyValue'
>>> [v, v, v] == [1, 2, 'foo']
True
>>> [v, v, 1] == [1, 2, 'foo']
False
>>> [v, v] == [1, 2, 'foo']
False
>>> {'a': v, 'b': 2} == {'a': 1, 'b': 2}
True
Short alias:
>>> from cykooz.testing import ANY
>>> 1 == ANY
True
RegExpString
Instance of this class is equal to any other values if it is matched to give regexp pattern.
>>> v = RegExpString('first.*')
>>> v == 1
False
>>> 1 == v
False
>>> v != 1
True
>>> v == 'first class'
True
>>> 'first class' == v
True
>>> v != 'first class'
False
>>> v
<RegExpString: first.*>
>>> {v: 1}
Traceback (most recent call last):
...
TypeError: unhashable type: 'RegExpString'
>>> [v, v, v] == [1, 2, 'first class']
False
>>> [v, v, v] == ['first class', 'first bus', 'first time']
True
Short alias:
>>> from cykooz.testing import R
>>> 'first class' == R('first.*')
True
Url
A url object that can be compared with other url objects without regard to the vagaries of encoding, escaping, and ordering of parameters in query strings.
>>> from cykooz.testing import Url
>>> url1 = Url('http://domain.com/container?limit=6&offset=0')
>>> url2 = Url('http://domain.com/container?offset=0&limit=6')
>>> url1 == url2
True
>>> url2 = Url('http://domain.com/container?limit=6')
>>> url1 == url2
False
>>> url1 == 'http://domain.com/container?offset=0&limit=6'
True
>>> 'http://domain.com/container?offset=0&limit=6' == url1
True
>>> {'key': 'http://domain.com/container?offset=0&limit=6'} == {'key': url1}
True
CHANGELOG
1.0 (2019-07-12)
Features
Initial release.
Metadata
Release files for cykooz-testing 1.0
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 |
|---|---|---|---|---|
| cykooz.testing-1.0.tar.gz | 7.6 kB | Without provenance | Details for cykooz.testing-1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cykooz.testing-1.0-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details for cykooz.testing-1.0-py2.py3-none-any.whl |
Total release size: 13.3 kB
Release files / cykooz.testing-1.0.tar.gz
| Download URL | cykooz.testing-1.0.tar.gz |
|---|---|
| Size | 7.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
88ec5a01bd6391ecafe1905c8831411ebf7f1a9e55750da1e6b7ffd97669ddb7
|
|
BLAKE2b-256 checksum How to use checksums |
21fb6114eb892a683a26df0c29d0014180e64b10031046cf308a6fced17f7f59
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3
|
Release files / cykooz.testing-1.0-py2.py3-none-any.whl
| Download URL | cykooz.testing-1.0-py2.py3-none-any.whl |
|---|---|
| Size | 5.8 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
bc712fe81a1b54062239c160fc14944b03679d0331c7901d64151d53062675e8
|
|
BLAKE2b-256 checksum How to use checksums |
ec97b059d21d58d1e4d5662039daf35e710e8621af07a4f6398a479687b2bb2d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3
|
Security for cykooz-testing 1.0
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.