Changeset View
Changeset View
Standalone View
Standalone View
swh/storage/tests/test_backfill.py
Show First 20 Lines • Show All 145 Lines • ▼ Show 20 Lines | def test_compute_query_release(): | ||||
assert where_args == ["\x000002", "\x000003"] | assert where_args == ["\x000002", "\x000003"] | ||||
assert column_aliases == [ | assert column_aliases == [ | ||||
"id", | "id", | ||||
"date", | "date", | ||||
"date_offset", | "date_offset", | ||||
"date_neg_utc_offset", | "date_neg_utc_offset", | ||||
"date_offset_bytes", | |||||
"comment", | "comment", | ||||
"name", | "name", | ||||
"synthetic", | "synthetic", | ||||
"target", | "target", | ||||
"target_type", | "target_type", | ||||
"author_id", | "author_id", | ||||
"author_name", | "author_name", | ||||
"author_email", | "author_email", | ||||
"author_fullname", | "author_fullname", | ||||
"raw_manifest", | |||||
] | ] | ||||
assert ( | assert ( | ||||
query | query | ||||
== """ | == """ | ||||
select release.id as id,date,date_offset,date_neg_utc_offset,comment,release.name as name,synthetic,target,target_type,a.id as author_id,a.name as author_name,a.email as author_email,a.fullname as author_fullname | select release.id as id,date,date_offset,date_neg_utc_offset,date_offset_bytes,comment,release.name as name,synthetic,target,target_type,a.id as author_id,a.name as author_name,a.email as author_email,a.fullname as author_fullname,raw_manifest | ||||
from release | from release | ||||
left join person a on release.author=a.id | left join person a on release.author=a.id | ||||
where (release.id) >= %s and (release.id) < %s | where (release.id) >= %s and (release.id) < %s | ||||
""" # noqa | """ # noqa | ||||
) | ) | ||||
@pytest.mark.parametrize("numbits", [2, 3, 8, 16]) | @pytest.mark.parametrize("numbits", [2, 3, 8, 16]) | ||||
▲ Show 20 Lines • Show All 125 Lines • Show Last 20 Lines |