forked from ChelseaKR/ca-tariff-parse
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconftest.py
More file actions
48 lines (35 loc) · 1.22 KB
/
Copy pathconftest.py
File metadata and controls
48 lines (35 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
"""Shared fixtures."""
from __future__ import annotations
from pathlib import Path
import pytest
FIXTURES = Path(__file__).parent / "fixtures"
GOLDEN = Path(__file__).parent / "golden"
REPO_ROOT = Path(__file__).resolve().parents[1]
SOURCES = REPO_ROOT / "sources"
COMPLETE = FIXTURES / "SYNTHETIC-example-schedule-complete.txt"
UNKNOWN = FIXTURES / "SYNTHETIC-example-schedule-unknown-section.txt"
#: A fixture in the second publisher's shape: a keyword column outline,
#: negatives in accounting brackets and a supersession header. Used to exercise
#: the document profile offline, without redistributing anyone's document.
KEYWORD = FIXTURES / "SYNTHETIC-example-keyword-schedule.txt"
@pytest.fixture
def complete_fixture() -> Path:
return COMPLETE
@pytest.fixture
def unknown_fixture() -> Path:
return UNKNOWN
@pytest.fixture
def keyword_fixture() -> Path:
return KEYWORD
def provenance(**overrides: object) -> dict[str, object]:
base: dict[str, object] = {
"document_id": "synthetic-doc",
"document_sha256": "a" * 64,
"page": 1,
"sheet": "SYN-1",
"section": "II.A",
"line": 3,
"snippet": "Peak $/kWh $1.0000",
}
base.update(overrides)
return base