55 lines
1.4 KiB
Python
55 lines
1.4 KiB
Python
"""Tests for rex.format — Format model, registry, and reader stubs."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from pathlib import Path
|
|
|
|
import pytest
|
|
|
|
from rex.format import (
|
|
read_csv,
|
|
read_docx,
|
|
read_excel,
|
|
read_fixed,
|
|
read_json,
|
|
read_pdf,
|
|
read_text,
|
|
read_xml,
|
|
)
|
|
|
|
|
|
class TestReaderStubs:
|
|
"""All reader functions are NotImplementedError stubs."""
|
|
|
|
def test_read_text(self) -> None:
|
|
with pytest.raises(NotImplementedError):
|
|
list(read_text(Path("fake.lst")))
|
|
|
|
def test_read_fixed(self) -> None:
|
|
with pytest.raises(NotImplementedError):
|
|
list(read_fixed(Path("fake.dat")))
|
|
|
|
def test_read_excel(self) -> None:
|
|
with pytest.raises(NotImplementedError):
|
|
list(read_excel(Path("fake.xlsx")))
|
|
|
|
def test_read_csv(self) -> None:
|
|
with pytest.raises(NotImplementedError):
|
|
list(read_csv(Path("fake.csv")))
|
|
|
|
def test_read_pdf(self) -> None:
|
|
with pytest.raises(NotImplementedError):
|
|
list(read_pdf(Path("fake.pdf")))
|
|
|
|
def test_read_json(self) -> None:
|
|
with pytest.raises(NotImplementedError):
|
|
list(read_json(Path("fake.json")))
|
|
|
|
def test_read_xml(self) -> None:
|
|
with pytest.raises(NotImplementedError):
|
|
list(read_xml(Path("fake.xml")))
|
|
|
|
def test_read_docx(self) -> None:
|
|
with pytest.raises(NotImplementedError):
|
|
list(read_docx(Path("fake.docx")))
|