4.36.4
This commit is contained in:
@ -58,7 +58,7 @@ def test_different_scenarios_v4_2(flask_client):
|
||||
assert r.json["suffixes"]
|
||||
assert r.json["prefix_suggestion"] == "" # no hostname => no suggestion
|
||||
|
||||
for (suffix, signed_suffix) in r.json["suffixes"]:
|
||||
for suffix, signed_suffix in r.json["suffixes"]:
|
||||
assert signed_suffix.startswith(suffix)
|
||||
|
||||
# <<< with hostname >>>
|
||||
|
@ -56,13 +56,15 @@ def test_get_jobs_to_run(flask_client):
|
||||
run_at=now.shift(hours=3),
|
||||
)
|
||||
# Job out of attempts
|
||||
Job.create(
|
||||
name="",
|
||||
payload="",
|
||||
state=JobState.taken.value,
|
||||
taken_at=now.shift(minutes=-(config.JOB_TAKEN_RETRY_WAIT_MINS + 10)),
|
||||
attempts=config.JOB_MAX_ATTEMPTS + 1,
|
||||
),
|
||||
(
|
||||
Job.create(
|
||||
name="",
|
||||
payload="",
|
||||
state=JobState.taken.value,
|
||||
taken_at=now.shift(minutes=-(config.JOB_TAKEN_RETRY_WAIT_MINS + 10)),
|
||||
attempts=config.JOB_MAX_ATTEMPTS + 1,
|
||||
),
|
||||
)
|
||||
Session.commit()
|
||||
jobs = get_jobs_to_run()
|
||||
assert len(jobs) == len(expected_jobs_to_run)
|
||||
|
@ -7,7 +7,7 @@ import arrow
|
||||
import pytest
|
||||
|
||||
from app import config
|
||||
from app.config import MAX_ALERT_24H, EMAIL_DOMAIN, ROOT_DIR
|
||||
from app.config import MAX_ALERT_24H, ROOT_DIR
|
||||
from app.db import Session
|
||||
from app.email_utils import (
|
||||
get_email_domain_part,
|
||||
@ -16,7 +16,6 @@ from app.email_utils import (
|
||||
delete_header,
|
||||
add_or_replace_header,
|
||||
send_email_with_rate_control,
|
||||
copy,
|
||||
get_spam_from_header,
|
||||
get_header_from_bounce,
|
||||
add_header,
|
||||
|
@ -17,7 +17,7 @@ def test_encode_decode(flask_client):
|
||||
|
||||
jwt_token = make_id_token(client_user)
|
||||
|
||||
assert type(jwt_token) is str
|
||||
assert isinstance(jwt_token, str)
|
||||
assert verify_id_token(jwt_token)
|
||||
|
||||
|
||||
|
@ -49,9 +49,9 @@ def encrypt_decrypt_text(text: str):
|
||||
priv = pgpy.PGPKey()
|
||||
priv.parse(private_key)
|
||||
decrypted = priv.decrypt(encrypted).message
|
||||
if type(decrypted) == str:
|
||||
if isinstance(decrypted, str):
|
||||
assert decrypted == text
|
||||
elif type(decrypted) == bytearray:
|
||||
elif isinstance(decrypted, bytearray):
|
||||
assert decrypted.decode() == text
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user