Skip to content

Commit e349e75

Browse files
committed
Ready for initial package release
1 parent 46d318f commit e349e75

14 files changed

Lines changed: 16 additions & 20 deletions

.github/workflows/tests.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ jobs:
2323
python -m pip install --upgrade pip
2424
pip install -e ".[dev]"
2525
26+
- name: Generate schema cache
27+
run: |
28+
python -c "from json2ubl.core.schema_cache_builder import SchemaCacheBuilder; SchemaCacheBuilder().build_all_caches()"
29+
2630
- name: Run tests
2731
run: |
2832
pytest --cov=json2ubl --cov-report=xml --cov-report=term-missing

tests/conftest.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,68 +7,68 @@
77
@pytest.fixture
88
def test_files_dir():
99
"""Return test files directory path."""
10-
return Path(__file__).parent.parent / "test_files"
10+
return Path(__file__).parent / "test_files"
1111

1212

1313
@pytest.fixture
1414
def invoice_dict():
1515
"""Load invoice test data."""
16-
test_files_path = Path(__file__).parent.parent / "test_files" / "invoice.json"
16+
test_files_path = Path(__file__).parent / "test_files" / "invoice.json"
1717
data = json.loads(test_files_path.read_text())
1818
return data[0] if isinstance(data, list) else data
1919

2020

2121
@pytest.fixture
2222
def credit_note_dict():
2323
"""Load credit note test data."""
24-
test_files_path = Path(__file__).parent.parent / "test_files" / "credit_note.json"
24+
test_files_path = Path(__file__).parent / "test_files" / "credit_note.json"
2525
data = json.loads(test_files_path.read_text())
2626
return data[0] if isinstance(data, list) else data
2727

2828

2929
@pytest.fixture
3030
def debit_note_dict():
3131
"""Load debit note test data."""
32-
test_files_path = Path(__file__).parent.parent / "test_files" / "debit_note.json"
32+
test_files_path = Path(__file__).parent / "test_files" / "debit_note.json"
3333
data = json.loads(test_files_path.read_text())
3434
return data[0] if isinstance(data, list) else data
3535

3636

3737
@pytest.fixture
3838
def self_billed_invoice_dict():
3939
"""Load self-billed invoice test data."""
40-
test_files_path = Path(__file__).parent.parent / "test_files" / "self_billed_invoice.json"
40+
test_files_path = Path(__file__).parent / "test_files" / "self_billed_invoice.json"
4141
data = json.loads(test_files_path.read_text())
4242
return data[0] if isinstance(data, list) else data
4343

4444

4545
@pytest.fixture
4646
def self_billed_credit_note_dict():
4747
"""Load self-billed credit note test data."""
48-
test_files_path = Path(__file__).parent.parent / "test_files" / "self_billed_credit_note.json"
48+
test_files_path = Path(__file__).parent / "test_files" / "self_billed_credit_note.json"
4949
data = json.loads(test_files_path.read_text())
5050
return data[0] if isinstance(data, list) else data
5151

5252

5353
@pytest.fixture
5454
def freight_invoice_dict():
5555
"""Load freight invoice test data."""
56-
test_files_path = Path(__file__).parent.parent / "test_files" / "freight_invoice.json"
56+
test_files_path = Path(__file__).parent / "test_files" / "freight_invoice.json"
5757
data = json.loads(test_files_path.read_text())
5858
return data[0] if isinstance(data, list) else data
5959

6060

6161
@pytest.fixture
6262
def invalid_doctype_dict():
6363
"""Load invalid document type test data."""
64-
test_files_path = Path(__file__).parent.parent / "test_files" / "invoice_invalid_doctype.json"
64+
test_files_path = Path(__file__).parent / "test_files" / "invoice_invalid_doctype.json"
6565
data = json.loads(test_files_path.read_text())
6666
return data[0] if isinstance(data, list) else data
6767

6868

6969
@pytest.fixture
7070
def missing_doctype_dict():
7171
"""Load missing document type test data."""
72-
test_files_path = Path(__file__).parent.parent / "test_files" / "invoice_missing_doctype.json"
72+
test_files_path = Path(__file__).parent / "test_files" / "invoice_missing_doctype.json"
7373
data = json.loads(test_files_path.read_text())
7474
return data[0] if isinstance(data, list) else data

tests/test_error_handling.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
from json2ubl import (
2-
json_dict_to_ubl_xml,
3-
json_file_to_ubl_xml_dict,
4-
json_file_to_ubl_xml_files,
5-
)
1+
from json2ubl import json_dict_to_ubl_xml, json_file_to_ubl_xml_dict, json_file_to_ubl_xml_files
62

73

84
class TestDocumentTypeValidation:
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)