Skip to content

Commit d375f17

Browse files
committed
Add test case for base name with grouping in between.
1 parent 4bb98dc commit d375f17

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/ttsim/time_conversion.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ def _create_time_conversion_functions(
455455
)
456456

457457
match = time_unit_pattern.fullmatch(name)
458-
base_name = match.group("base_name") or ""
458+
base_name = match.group("base_name")
459459
time_unit = match.group("time_unit") or ""
460460
aggregation = match.group("aggregation") or ""
461461

tests/ttsim/test_shared.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,7 @@ def test_potential_target_names_from_base_name(
360360
("foo_m", ["m", "y"], ["hh"], "foo", "m", None),
361361
("foo_y", ["m", "y"], ["hh"], "foo", "y", None),
362362
("foo_hh", ["m", "y"], ["hh"], "foo", None, "hh"),
363+
("foo_hh_bar", ["m", "y"], ["hh"], "foo_hh_bar", None, None),
363364
],
364365
)
365366
def test_get_re_pattern_for_time_units_and_groupings(

0 commit comments

Comments
 (0)