BTHLABS-61: Service layer refactoring

A journey to fix `ValidationError` in Pocket imports turned service
layer refactoring :D
This commit is contained in:
2025-10-12 18:37:32 +00:00
parent ac7a8dd90e
commit 8b86145519
45 changed files with 1023 additions and 337 deletions

View File

@@ -64,11 +64,25 @@ def pocket_import_banned_netloc_save_spec():
})
@pytest.fixture
def pocket_import_invalid_url_spec():
return PocketImportSaveSpec.model_validate({
'title': "This isn't right",
'url': 'thisisntright',
'time_added': datetime.datetime(
2021, 1, 18, 8, 0, 0, 0, tzinfo=datetime.UTC,
),
'tags': '',
'status': 'unread',
})
@pytest.fixture
def pocket_csv_content(pocket_import_created_save_spec,
pocket_import_reused_save_spec,
pocket_import_other_account_save_spec,
pocket_import_banned_netloc_save_spec,
pocket_import_invalid_url_spec,
):
with io.StringIO() as csv_f:
field_names = [
@@ -82,6 +96,7 @@ def pocket_csv_content(pocket_import_created_save_spec,
pocket_import_reused_save_spec.dict(),
pocket_import_other_account_save_spec.dict(),
pocket_import_banned_netloc_save_spec.dict(),
pocket_import_invalid_url_spec.dict(),
])
csv_f.seek(0)