6
6
from rules_engine import parser
7
7
from rules_engine .pydantic_models import (
8
8
NaturalGasBillingRecordInput ,
9
- ElectricBillingRecordInput
9
+ ElectricBillingRecordInput ,
10
10
)
11
11
12
12
ROOT_DIR = pathlib .Path (__file__ ).parent / "cases" / "examples"
@@ -29,22 +29,26 @@ def _read_gas_bill_national_grid() -> str:
29
29
30
30
def _get_gas_bill_xml_path () -> pathlib .Path :
31
31
"""Return the path of a test natural gas XML bill"""
32
- return (pathlib .Path (__file__ ).parent
33
- / "cases"
34
- / "parsing"
35
- / "xml"
36
- / "natural_gas"
37
- / "ngma_natural_gas_billing_billing_data_Service 1_1_2021-05-26_to_2024-04-25.xml" )
32
+ return (
33
+ pathlib .Path (__file__ ).parent
34
+ / "cases"
35
+ / "parsing"
36
+ / "xml"
37
+ / "natural_gas"
38
+ / "ngma_natural_gas_billing_billing_data_Service 1_1_2021-05-26_to_2024-04-25.xml"
39
+ )
38
40
39
41
40
42
def _get_electric_bill_xml_path () -> pathlib .Path :
41
43
"""Return the path of a test natural gas XML bill"""
42
- return (pathlib .Path (__file__ ).parent
43
- / "cases"
44
- / "parsing"
45
- / "xml"
46
- / "electricicity"
47
- / "TestGBDataHourlyNineDaysBinnedDaily.xml" )
44
+ return (
45
+ pathlib .Path (__file__ ).parent
46
+ / "cases"
47
+ / "parsing"
48
+ / "xml"
49
+ / "electricicity"
50
+ / "TestGBDataHourlyNineDaysBinnedDaily.xml"
51
+ )
48
52
49
53
50
54
def _validate_eversource (result ):
@@ -141,14 +145,14 @@ def test_parse_gas_bill_national_grid():
141
145
142
146
def test_parse_gas_bill_xml ():
143
147
"""Tests parsing a natural gas bill from a Green Button XML."""
144
- _validate_gas_bill_xml (
145
- parser ._parse_gas_bill_xml (_get_gas_bill_xml_path ()))
148
+ _validate_gas_bill_xml (parser ._parse_gas_bill_xml (_get_gas_bill_xml_path ()))
146
149
147
150
148
151
def test_parse_electric_bill_xml ():
149
152
"""Tests parsing an electricicity bill from a Green Button XML."""
150
153
_validate_electric_bill_xml (
151
- parser ._parse_electric_bill_xml (_get_electric_bill_xml_path ()))
154
+ parser ._parse_electric_bill_xml (_get_electric_bill_xml_path ())
155
+ )
152
156
153
157
154
158
def test_detect_natural_gas_company ():
0 commit comments