Commit 6e47a40c authored by Pierre Dittgen's avatar Pierre Dittgen
Browse files

Add tests

parent a063b2c8
......@@ -3,7 +3,7 @@ from pathlib import Path
import pytest
from validata_core import validate
from validata_core.helpers import FileContentValidataResource
from validata_core.helpers import FileContentValidataResource, URLValidataResource
def validate_xlsx_bytes(bytes_source_content, schema):
......@@ -18,7 +18,7 @@ def dae_schema():
return json.load(fd)
def test_validate_dae_xslx_(dae_schema):
def test_validate_dae_xlsx_file(dae_schema):
with Path("tests/fixtures/dae_test.xlsx").open("rb") as fd:
bytes_content = fd.read()
......@@ -27,3 +27,13 @@ def test_validate_dae_xslx_(dae_schema):
report = validate([header] + rows, dae_schema)
# breakpoint()
assert report.valid
def test_validate_dae_xlsx_url(dae_schema):
validata_source = URLValidataResource(
"https://git.opendatafrance.net/validata/validata-ui/uploads/dc50b16c803e2e2d61a645019cd75b3c/test1.xlsx"
)
header, rows = validata_source.extract_tabular_data()
report = validate([header] + rows, dae_schema)
assert report.valid
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment