|
7 | 7 | @pytest.fixture |
8 | 8 | def test_files_dir(): |
9 | 9 | """Return test files directory path.""" |
10 | | - return Path(__file__).parent.parent / "test_files" |
| 10 | + return Path(__file__).parent / "test_files" |
11 | 11 |
|
12 | 12 |
|
13 | 13 | @pytest.fixture |
14 | 14 | def invoice_dict(): |
15 | 15 | """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" |
17 | 17 | data = json.loads(test_files_path.read_text()) |
18 | 18 | return data[0] if isinstance(data, list) else data |
19 | 19 |
|
20 | 20 |
|
21 | 21 | @pytest.fixture |
22 | 22 | def credit_note_dict(): |
23 | 23 | """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" |
25 | 25 | data = json.loads(test_files_path.read_text()) |
26 | 26 | return data[0] if isinstance(data, list) else data |
27 | 27 |
|
28 | 28 |
|
29 | 29 | @pytest.fixture |
30 | 30 | def debit_note_dict(): |
31 | 31 | """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" |
33 | 33 | data = json.loads(test_files_path.read_text()) |
34 | 34 | return data[0] if isinstance(data, list) else data |
35 | 35 |
|
36 | 36 |
|
37 | 37 | @pytest.fixture |
38 | 38 | def self_billed_invoice_dict(): |
39 | 39 | """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" |
41 | 41 | data = json.loads(test_files_path.read_text()) |
42 | 42 | return data[0] if isinstance(data, list) else data |
43 | 43 |
|
44 | 44 |
|
45 | 45 | @pytest.fixture |
46 | 46 | def self_billed_credit_note_dict(): |
47 | 47 | """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" |
49 | 49 | data = json.loads(test_files_path.read_text()) |
50 | 50 | return data[0] if isinstance(data, list) else data |
51 | 51 |
|
52 | 52 |
|
53 | 53 | @pytest.fixture |
54 | 54 | def freight_invoice_dict(): |
55 | 55 | """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" |
57 | 57 | data = json.loads(test_files_path.read_text()) |
58 | 58 | return data[0] if isinstance(data, list) else data |
59 | 59 |
|
60 | 60 |
|
61 | 61 | @pytest.fixture |
62 | 62 | def invalid_doctype_dict(): |
63 | 63 | """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" |
65 | 65 | data = json.loads(test_files_path.read_text()) |
66 | 66 | return data[0] if isinstance(data, list) else data |
67 | 67 |
|
68 | 68 |
|
69 | 69 | @pytest.fixture |
70 | 70 | def missing_doctype_dict(): |
71 | 71 | """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" |
73 | 73 | data = json.loads(test_files_path.read_text()) |
74 | 74 | return data[0] if isinstance(data, list) else data |
0 commit comments