1
0
personal-data/tests/test_myanimelist.py
Jon Michael Aanes 28e3fd8658
All checks were successful
Run Python tests (through Pytest) / Test (push) Successful in 36s
Verify Python project can be installed, loaded and have version checked / Test (push) Successful in 31s
Minimized tests
2025-03-16 22:15:05 +01:00

19 lines
633 B
Python

import pytest
from personal_data.fetchers.myanimelist import parse_name
@pytest.mark.parametrize(
'input_str, expected_group1, expected_group2',
[
('"Soundscape"', 'Soundscape', None),
('"Soundscape (サウンドスケープ)"', 'Soundscape', 'サウンドスケープ'),
('1: "Soundscape"', 'Soundscape', None),
('2: "Soundscape (サウンドスケープ)"', 'Soundscape', 'サウンドスケープ'),
],
)
def test_parse_name(input_str, expected_group1, expected_group2):
m = parse_name(input_str)
assert m.group(1) == expected_group1
assert m.group(2) == expected_group2