Skip to content
Snippets Groups Projects
Verified Commit bd9a2f41 authored by Georg Krause's avatar Georg Krause
Browse files

style: Format everything with black

parent 1b02ecb3
Branches
No related tags found
No related merge requests found
Pipeline #26301 passed
......@@ -26,7 +26,7 @@ domain_filters = {
def validate_domain(raw):
raw = raw.split('://')[-1]
raw = raw.split("://")[-1]
if not raw:
raise ValueError()
......
......@@ -9,20 +9,20 @@ from arq import cron
async def poll(ctx, domain):
session: ClientSession = ctx['session']
session: ClientSession = ctx["session"]
pool = await db.get_pool(settings.DB_DSN)
async with pool as conn:
return await crawler.check(conn=conn, session=session, domain=domain)
async def update_all(ctx):
pool = await db.get_pool(settings.DB_DSN)
for check in await db.get_latest_check_by_domain(pool):
await poll(ctx, check["domain"])
class WorkerSettings:
cron_jobs = [
cron(update_all, minute=None)
]
cron_jobs = [cron(update_all, minute=None)]
max_concurrent_tasks = 20
shutdown_delay = 5
timeout_seconds = 15
......@@ -132,10 +132,13 @@ async def test_domains_rss(db_conn, factories, client, mocker):
assert resp.headers["content-type"] == "application/rss+xml"
@pytest.mark.parametrize('input,expected', [
('example.com', 'example.com'),
('http://example.com', 'example.com'),
('https://example.com', 'example.com'),
])
@pytest.mark.parametrize(
"input,expected",
[
("example.com", "example.com"),
("http://example.com", "example.com"),
("https://example.com", "example.com"),
],
)
def test_validate_domain(input, expected):
assert routes.validate_domain(input) == expected
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment