Skip to content

Commit

Permalink
Added support for environment
Browse files Browse the repository at this point in the history
  • Loading branch information
eprbell committed Jun 25, 2024
1 parent 66c3e87 commit 5bb790f
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions tests/abstract_test_ods_output_diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from enum import Enum
from pathlib import Path
from subprocess import run
from typing import List, Optional
from typing import Dict, List, Optional

from ods_diff import ods_diff

Expand All @@ -38,6 +38,7 @@ class OutputPlugins(Enum):
TAX_REPORT_US = "tax_report_us"
TAX_REPORT_IE = "tax_report_ie"


class AbstractTestODSOutputDiff(unittest.TestCase):
# Temporarily removed lifo and hifo due to https://github.com/eprbell/rp2/issues/79
METHODS: List[str] = ["fifo", "lifo", "hifo"]
Expand Down Expand Up @@ -69,6 +70,7 @@ def _generate(
allow_negative_balances: bool = False,
generation_language: Optional[str] = None,
country: str = "us",
env: Optional[Dict[str, str]] = None,
) -> None:
config = test_name if config is None else config
time_interval: str = cls.__get_time_interval(from_date, to_date)
Expand Down Expand Up @@ -96,8 +98,12 @@ def _generate(
str(input_path / Path(f"{test_name}.ods")),
]
)

run(arguments, check=True)
if not env:
run(arguments, check=True)
else:
merged_env = os.environ.copy()
merged_env.update(env)
run(arguments, check=True, env=merged_env)

def _compare(
self,
Expand Down

0 comments on commit 5bb790f

Please sign in to comment.