Renamed "fh" to "fp" when opening files, following the Python convention.

This commit is contained in:
2023-02-09 00:02:14 +08:00
parent d99f592cff
commit 36f55900c7
4 changed files with 8 additions and 8 deletions

View File

@ -57,13 +57,13 @@ class BaseAccountCommandTestCase(unittest.TestCase):
from accounting import data_dir
from accounting.models import BaseAccount
with open(data_dir / "base_accounts.csv") as fh:
with open(data_dir / "base_accounts.csv") as fp:
data: dict[dict[str, t.Any]] \
= {x["code"]: {"code": x["code"],
"title": x["title"],
"l10n": {y[5:]: x[y]
for y in x if y.startswith("l10n-")}}
for x in csv.DictReader(fh)}
for x in csv.DictReader(fp)}
runner: FlaskCliRunner = self.app.test_cli_runner()
result: Result = runner.invoke(args="accounting-init-base")

View File

@ -88,13 +88,13 @@ class CurrencyCommandTestCase(unittest.TestCase):
from accounting import data_dir
from accounting.models import Currency
with open(data_dir / "currencies.csv") as fh:
with open(data_dir / "currencies.csv") as fp:
data: dict[dict[str, t.Any]] \
= {x["code"]: {"code": x["code"],
"name": x["name"],
"l10n": {y[5:]: x[y]
for y in x if y.startswith("l10n-")}}
for x in csv.DictReader(fh)}
for x in csv.DictReader(fp)}
runner: FlaskCliRunner = self.app.test_cli_runner()
with self.app.app_context():