Skip to content

Commit fb706fa

Browse files
committed
autoformat: isort & black
1 parent 195e083 commit fb706fa

File tree

2 files changed

+21
-16
lines changed

2 files changed

+21
-16
lines changed

tests/conftest.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
from pathlib import Path
2-
from typing import Dict, List, Any
2+
from typing import Any, Dict, List
33

44
import pytest
5-
from hydrolib.core.dflowfm.bc.models import \
6-
TimeInterpolation, QuantityUnitPair, VerticalInterpolation,VerticalPositionType
5+
6+
from hydrolib.core.dflowfm.bc.models import (
7+
QuantityUnitPair,
8+
TimeInterpolation,
9+
VerticalInterpolation,
10+
VerticalPositionType,
11+
)
12+
713

814
@pytest.fixture
915
def input_files_dir() -> Path:
@@ -217,6 +223,7 @@ def quantityunitpair(quantity, unit, verticalpositionindex=None):
217223
quantity=quantity, unit=unit, vertpositionindex=verticalpositionindex
218224
)
219225

226+
220227
@pytest.fixture
221228
def time_series_values() -> Dict[str, Any]:
222229
return dict(
@@ -232,6 +239,7 @@ def time_series_values() -> Dict[str, Any]:
232239
datablock=[["0", "1.23"], ["60", "2.34"], ["120", "3.45"]],
233240
)
234241

242+
235243
@pytest.fixture
236244
def t3d_values():
237245
return dict(
@@ -254,4 +262,4 @@ def t3d_values():
254262
["60", "4", "5", "6"],
255263
["120", "7", "8", "9"],
256264
],
257-
)
265+
)

tests/dflowfm/bc/test_bc.py

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
)
1919
from hydrolib.core.dflowfm.ini.models import BaseModel
2020
from hydrolib.core.dflowfm.ini.parser import Parser, ParserConfig
21-
2221
from tests.utils import (
2322
assert_files_equal,
2423
test_input_dir,
@@ -175,9 +174,6 @@ def test_initialize_timeseries_with_wrong_amount_vectorquantities(
175174
assert expected_error_mssg in str(error.value)
176175

177176

178-
179-
180-
181177
class TestVectorForcingBase:
182178
class VectorForcingTest(VectorForcingBase):
183179
function: Literal["testfunction"] = "testfunction"
@@ -315,7 +311,7 @@ def test_initialize_t3d(
315311
self,
316312
vertical_position_type: str,
317313
exp_vertical_position_type: VerticalPositionType,
318-
t3d_values
314+
t3d_values,
319315
):
320316
t3d_values["vertpositiontype"] = vertical_position_type
321317

@@ -368,7 +364,9 @@ def test_create_t3d_first_quantity_not_time_raises_error(self, t3d_values):
368364
expected_message = "First quantity should be `time`"
369365
assert expected_message in str(error.value)
370366

371-
def test_create_t3d_time_quantity_with_verticalpositionindex_raises_error(self, t3d_values):
367+
def test_create_t3d_time_quantity_with_verticalpositionindex_raises_error(
368+
self, t3d_values
369+
):
372370

373371
t3d_values["quantityunitpair"] = [
374372
_create_quantityunitpair("time", TEST_TIME_UNIT, 1),
@@ -412,10 +410,7 @@ def test_create_t3d_verticalpositionindex_missing_for_non_time_unit_raises_error
412410
],
413411
)
414412
def test_create_t3d_verticalposition_in_quantityunitpair_has_invalid_value_raises_error(
415-
self,
416-
vertpositions: List[float],
417-
verticalpositionindexes: List[int],
418-
t3d_values
413+
self, vertpositions: List[float], verticalpositionindexes: List[int], t3d_values
419414
):
420415
time_quantityunitpair = [_create_quantityunitpair("time", TEST_TIME_UNIT)]
421416
other_quantutyunitpairs = []
@@ -447,7 +442,7 @@ def test_create_t3d_number_of_verticalindexpositions_not_as_expected_raises_erro
447442
self,
448443
number_of_quantities_and_units: int,
449444
number_of_verticalpositionindexes: int,
450-
t3d_values
445+
t3d_values,
451446
):
452447
del t3d_values["quantityunitpair"]
453448

@@ -525,7 +520,9 @@ def test_create_t3d_creates_correct_quantityunitpairs_using_verticalpositioninde
525520
expected_quantityunitpairs = []
526521

527522
for quantity, unit, verticalpositionindex in zip(
528-
t3d_values["quantity"], t3d_values["unit"], [None] + t3d_values["vertpositionindex"]
523+
t3d_values["quantity"],
524+
t3d_values["unit"],
525+
[None] + t3d_values["vertpositionindex"],
529526
):
530527
expected_quantityunitpairs.append(
531528
_create_quantityunitpair(quantity, unit, verticalpositionindex)

0 commit comments

Comments
 (0)