| 1 |
from pathlib import Path |
| 2 |
import sys |
| 3 |
|
| 4 |
import pytest |
| 5 |
|
| 6 |
# "dxwf" is the abbreviated name for daps-xmlwellformed |
| 7 |
# We can't import a name with a "-" so we use a link here: |
| 8 |
import dxwf |
| 9 |
|
| 10 |
|
| 11 |
THISDIR = Path(__file__).parent |
| 12 |
DATADIR = THISDIR / "data" |
| 13 |
GOODDIR = DATADIR / "good" |
| 14 |
|
| 15 |
|
| 16 |
@pytest.mark.parametrize("xmlfile", [ |
| 17 |
"test-wents-wxi.xml", |
| 18 |
"test-defined-entity.xml", |
| 19 |
"test-external-entity.xml", |
| 20 |
"test-defined-entity-with-xinclude.xml", |
| 21 |
]) |
| 22 |
def test_check_wellformedness(xmlfile): |
| 23 |
# Given |
| 24 |
xmlfile = str(GOODDIR / xmlfile) |
| 25 |
|
| 26 |
# When |
| 27 |
result = dxwf.check_wellformedness(xmlfile) |
| 28 |
|
| 29 |
# Then |
| 30 |
assert result == 0 |