mirror of
https://github.com/bellingcat/auto-archiver-api.git
synced 2026-06-08 03:28:35 +03:00
Format and lint web directory (#67)
This commit is contained in:
@@ -14,8 +14,8 @@ def test_update_sheet_last_url_archived_at(db_session):
|
||||
assert isinstance(test_sheet.last_url_archived_at, datetime)
|
||||
before = test_sheet.last_url_archived_at
|
||||
assert (
|
||||
worker_crud.update_sheet_last_url_archived_at(db_session, "sheet-123")
|
||||
is True
|
||||
worker_crud.update_sheet_last_url_archived_at(db_session, "sheet-123")
|
||||
is True
|
||||
)
|
||||
db_session.refresh(test_sheet)
|
||||
assert isinstance(test_sheet.last_url_archived_at, datetime)
|
||||
@@ -23,10 +23,10 @@ def test_update_sheet_last_url_archived_at(db_session):
|
||||
|
||||
# Test non-existent sheet
|
||||
assert (
|
||||
worker_crud.update_sheet_last_url_archived_at(
|
||||
db_session, "non-existent-sheet"
|
||||
)
|
||||
is False
|
||||
worker_crud.update_sheet_last_url_archived_at(
|
||||
db_session, "non-existent-sheet"
|
||||
)
|
||||
is False
|
||||
)
|
||||
|
||||
|
||||
@@ -42,14 +42,14 @@ def test_create_or_get_user(test_data, db_session):
|
||||
|
||||
# already exists
|
||||
assert (
|
||||
u1 := worker_crud.create_or_get_user(db_session, "rick@example.com")
|
||||
) is not None
|
||||
u1 := worker_crud.create_or_get_user(db_session, "rick@example.com")
|
||||
) is not None
|
||||
assert u1.email == "rick@example.com"
|
||||
|
||||
# new user
|
||||
assert (
|
||||
u2 := worker_crud.create_or_get_user(db_session, "beth@example.com")
|
||||
) is not None
|
||||
u2 := worker_crud.create_or_get_user(db_session, "beth@example.com")
|
||||
) is not None
|
||||
assert u2.email == "beth@example.com"
|
||||
|
||||
assert db_session.query(models.User).count() == 4
|
||||
@@ -64,8 +64,8 @@ def test_create_tag(db_session):
|
||||
assert create_tag.id == "tag-101"
|
||||
assert db_session.query(models.Tag).count() == 1
|
||||
assert (
|
||||
db_session.query(models.Tag).filter(models.Tag.id == "tag-101").first()
|
||||
== create_tag
|
||||
db_session.query(models.Tag).filter(models.Tag.id == "tag-101").first()
|
||||
== create_tag
|
||||
)
|
||||
|
||||
# same id does not add new db entry
|
||||
|
||||
Reference in New Issue
Block a user