===================
[](https://travis-ci.org/richardasaurus/python-xmlunittest-better)
[](https://crate.io/packages/xmlunittestbetter/)
This is a spork of [https://github.com/Exirel/python-xmlunittest](https://github.com/Exirel/python-xmlunittest).
With wider lxml support and Python 2.7, 3.4 & 3.4 support.
Examples
======
- Extend xmlunittest.XmlTestCase
- Write your tests, using the function or method that generate XML document
- Use xmlunittest.XmlTestCase‘s assertion methods to validate
- Keep your test readable
Example:
```
from xmlunittest import XmlTestCase
class CustomTestCase(XmlTestCase):
def test_my_custom_test(self):
# In a real case, data come from a call to your function/method.
data = """<?xml version="1.0" encoding="UTF-8" ?>
<root xmlns:ns="uri">
<leaf id="1" active="on" />
<leaf id="2" active="on" />
<leaf id="3" active="off" />
</root>"""
# Everything starts with `assert_xml_document`
root = self.assert_xml_document(data)
# Check namespace
self.assert_xml_namespace(root, 'ns', 'uri')
# Check
self.assert_xpaths_unique_value(root, ('./leaf@id', ))
self.assert_xpath_values(root, './leaf@active', ('on', 'off'))
```
Running the tests
======
To run the unit tests for this package::
```
pip install tox
tox
```
Metadata
Release files for xmlunittestbetter 0.1
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 |
|---|---|---|---|---|
| xmlunittestbetter-0.1.tar.gz | 4.9 kB | Without provenance | Details for xmlunittestbetter-0.1.tar.gz |
Release files / xmlunittestbetter-0.1.tar.gz
| Download URL | xmlunittestbetter-0.1.tar.gz |
|---|---|
| Size | 4.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3916cc01afd6a32eb8d785fad20e7f0075e0302299f3006c668eb812bd0ff0ab
|
|
BLAKE2b-256 checksum How to use checksums |
b17851d64624bc86aca0131614969b7a83487e08c22669ad070b2249ecba0cf5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for xmlunittestbetter 0.1
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.