Skip to content

Commit

Permalink
refactored test directory structure
Browse files Browse the repository at this point in the history
Co-authored-by: eriksynn <[email protected]>
Co-authored-by: Debajyoti Debnath <[email protected]>
Co-authored-by: Jonathan Kwan <[email protected]>
Co-authored-by: thatoldplatitude <[email protected]>
  • Loading branch information
5 people committed May 22, 2024
1 parent b2b533c commit adf4b28
Show file tree
Hide file tree
Showing 25 changed files with 4 additions and 3 deletions.
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@
# Test inputs are provided as separate directory within the "cases/examples" directory
# Each subdirectory contains a JSON file (named summary.json) which specifies the inputs for the test runner
ROOT_DIR = pathlib.Path(__file__).parent / "cases" / "examples"
NATURAL_GAS_DIR = ROOT_DIR / "natural_gas"

# TODO: example-2 is OIL; need to find the source data for example-1 and example-4 for Natural Gas and update csv
YET_TO_BE_UPDATED_EXAMPLES = ("example-1", "example-2", "example-4")
# Filter out failing examples for now
INPUT_DATA = filter(
lambda d: d not in YET_TO_BE_UPDATED_EXAMPLES, next(os.walk(ROOT_DIR))[1]
lambda d: d not in YET_TO_BE_UPDATED_EXAMPLES, next(os.walk(NATURAL_GAS_DIR))[1]
)


Expand All @@ -52,7 +53,7 @@ class Example(BaseModel):


def load_summary(folder: str) -> Summary:
with open(ROOT_DIR / folder / "summary.json") as f:
with open(NATURAL_GAS_DIR / folder / "summary.json") as f:
d = json.load(f)
return Summary(**d)

Expand All @@ -62,7 +63,7 @@ def load_natural_gas(
) -> NaturalGasBillingExampleInput:
records = []

with open(ROOT_DIR / folder / "natural-gas.csv") as f:
with open(NATURAL_GAS_DIR / folder / "natural-gas.csv") as f:
reader = csv.DictReader(f)
row: Any
for row in reader:
Expand Down

0 comments on commit adf4b28

Please sign in to comment.