diff --git a/git_time_tracker/__main__.py b/git_time_tracker/__main__.py index e85b8ff..bb1008c 100644 --- a/git_time_tracker/__main__.py +++ b/git_time_tracker/__main__.py @@ -19,7 +19,8 @@ def filter_samples( samples: list[ActivitySample], sample_filter: set[str], ) -> list[ActivitySample]: - assert len(sample_filter) > 0 + if not sample_filter: + raise ValueError("sample_filter must not be empty") return [s for s in samples if set(s.labels).intersection(sample_filter)] diff --git a/scripts/__init__.py b/scripts/__init__.py new file mode 100644 index 0000000..4fd3dda --- /dev/null +++ b/scripts/__init__.py @@ -0,0 +1 @@ +# This file marks the scripts directory as a package. diff --git a/scripts/download_simfiles.py b/scripts/download_simfiles.py index 9aa5055..d1d6c88 100644 --- a/scripts/download_simfiles.py +++ b/scripts/download_simfiles.py @@ -32,9 +32,9 @@ def parse_results(response) -> list[Result]: link = cells[0].a if link is None: continue - id = link['href'].removeprefix('viewsimfile.php?simfileid=') + simfile_id = link['href'].removeprefix('viewsimfile.php?simfileid=') levels = cells[1].get_text().strip() - results.append(Result(title, int(id), levels)) + results.append(Result(title, int(simfile_id), levels)) return results diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..00a6a8a --- /dev/null +++ b/tests/__init__.py @@ -0,0 +1 @@ +# This file marks the tests directory as a package. diff --git a/tests/test_myanimelist.py b/tests/test_myanimelist.py index 920c53a..9e7f721 100644 --- a/tests/test_myanimelist.py +++ b/tests/test_myanimelist.py @@ -4,7 +4,7 @@ from personal_data.fetchers.myanimelist import parse_name @pytest.mark.parametrize( - 'input_str, expected_group1, expected_group2', + ("input_str", "expected_group1", "expected_group2"), [ ('"Soundscape"', 'Soundscape', None), ('"Soundscape (サウンドスケープ)"', 'Soundscape', 'サウンドスケープ'),