Minimized tests
This commit is contained in:
parent
949888697d
commit
28e3fd8658
|
@ -195,7 +195,8 @@ def import_activity_samples(
|
||||||
default_estimated_duration: datetime.timedelta | None = None,
|
default_estimated_duration: datetime.timedelta | None = None,
|
||||||
) -> int:
|
) -> int:
|
||||||
samples = heuristically_realize_samples(
|
samples = heuristically_realize_samples(
|
||||||
raw_samples, default_estimated_duration=default_estimated_duration,
|
raw_samples,
|
||||||
|
default_estimated_duration=default_estimated_duration,
|
||||||
)
|
)
|
||||||
|
|
||||||
if group_category is not None:
|
if group_category is not None:
|
||||||
|
@ -277,7 +278,9 @@ def import_wanikani_events(vault: ObsidianVault, rows: Rows):
|
||||||
if k in row:
|
if k in row:
|
||||||
raw_samples.append(
|
raw_samples.append(
|
||||||
ActivitySample(
|
ActivitySample(
|
||||||
[Label('application.name', 'WaniKani')], None, row[k],
|
[Label('application.name', 'WaniKani')],
|
||||||
|
None,
|
||||||
|
row[k],
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
del k
|
del k
|
||||||
|
|
|
@ -14,17 +14,5 @@ from personal_data.fetchers.myanimelist import parse_name
|
||||||
)
|
)
|
||||||
def test_parse_name(input_str, expected_group1, expected_group2):
|
def test_parse_name(input_str, expected_group1, expected_group2):
|
||||||
m = parse_name(input_str)
|
m = parse_name(input_str)
|
||||||
assert m is not None, f'parse_name returned None for input: {input_str}'
|
assert m.group(1) == expected_group1
|
||||||
actual_group1 = m.group(1).strip() if m.group(1) is not None else None
|
assert m.group(2) == expected_group2
|
||||||
actual_group2 = m.group(2).strip() if m.group(2) is not None else None
|
|
||||||
assert actual_group1 == expected_group1, (
|
|
||||||
f'Expected group(1): {expected_group1} but got: {actual_group1}'
|
|
||||||
)
|
|
||||||
if expected_group2 is None:
|
|
||||||
assert actual_group2 is None, (
|
|
||||||
f'Expected group(2) to be None but got: {actual_group2}'
|
|
||||||
)
|
|
||||||
else:
|
|
||||||
assert actual_group2 == expected_group2, (
|
|
||||||
f'Expected group(2): {expected_group2} but got: {actual_group2}'
|
|
||||||
)
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user