Creating a budget overview from a SuperX export.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
1.0 KiB

2 months ago
"""Global test fixtures and Mocks"""
from pathlib import Path
import pytest
class MockWorkbookSheet:
def __init__(self, data):
self._data = data
@property
def rows(self):
return iter(self._data)
@pytest.fixture
def example_root(request):
root_dir = Path(request.config.rootdir)
2 months ago
return root_dir / "test_data"
@pytest.fixture
def budget_example_file(example_root):
return example_root / "Budget-Vorlage-2024.xlsx"
@pytest.fixture
def budget_example_workbook(budget_example_file):
import openpyxl
2 months ago
return openpyxl.open(budget_example_file)
@pytest.fixture
def budget_example_sheet(budget_example_workbook):
sheets = budget_example_workbook.sheetnames
first = sheets[0]
2 months ago
return budget_example_workbook[first]
@pytest.fixture
def superx_example_file(example_root):
return example_root / "Verwendungsnachweis_und_Kassenstand_SAP.xlsx"
@pytest.fixture
def superx_example_workbook(superx_example_file):
import openpyxl
2 months ago
return openpyxl.open(superx_example_file)