| 7 | |
| 8 | |
| 9 | def test_wbxml(tdata): |
| 10 | assert wbxml.prettify(b"\x03\x01\x6a\x00", Metadata()) == '<?xml version="1.0" ?>\n' |
| 11 | with pytest.raises(Exception): |
| 12 | wbxml.prettify(b"foo", Metadata()) |
| 13 | |
| 14 | # File taken from https://github.com/davidpshaw/PyWBXMLDecoder/tree/master/wbxml_samples |
| 15 | path = tdata.path(datadir + "data.wbxml") |
| 16 | with open(path, "rb") as f: |
| 17 | input = f.read() |
| 18 | with open("-formatted.".join(path.rsplit(".", 1))) as f: |
| 19 | expected = f.read() |
| 20 | |
| 21 | assert wbxml.prettify(input, Metadata()) == expected |
| 22 | |
| 23 | |
| 24 | def test_render_priority(): |