Changeset View
Changeset View
Standalone View
Standalone View
swh/loader/package/arch/tests/test_arch.py
# Copyright (C) 2022 The Software Heritage developers | # Copyright (C) 2022 The Software Heritage developers | ||||
# See the AUTHORS file at the top-level directory of this distribution | # See the AUTHORS file at the top-level directory of this distribution | ||||
# License: GNU General Public License version 3, or any later version | # License: GNU General Public License version 3, or any later version | ||||
# See top-level LICENSE file for more information | # See top-level LICENSE file for more information | ||||
# flake8: noqa: B950 | |||||
import pytest | import pytest | ||||
from swh.loader.package.arch.loader import ArchLoader | from swh.loader.package.arch.loader import ArchLoader | ||||
from swh.loader.tests import assert_last_visit_matches, check_snapshot, get_stats | from swh.loader.tests import assert_last_visit_matches, check_snapshot, get_stats | ||||
from swh.model.hashutil import hash_to_bytes | from swh.model.hashutil import hash_to_bytes | ||||
from swh.model.model import ( | from swh.model.model import ( | ||||
ObjectType, | ObjectType, | ||||
Person, | Person, | ||||
Release, | Release, | ||||
Snapshot, | Snapshot, | ||||
SnapshotBranch, | SnapshotBranch, | ||||
TargetType, | TargetType, | ||||
TimestampWithTimezone, | TimestampWithTimezone, | ||||
) | ) | ||||
EXPECTED_PACKAGES = [ | EXPECTED_PACKAGES = [ | ||||
{ | { | ||||
"url": "https://archive.archlinux.org/packages/d/dialog/", | "url": "https://archive.archlinux.org/packages/d/dialog/", | ||||
"artifacts": [ | "artifacts": [ | ||||
{ | { | ||||
"url": "https://archive.archlinux.org/packages/d/dialog/dialog-1:1.3_20190211-1-x86_64.pkg.tar.xz", # noqa: B950 | "url": "https://archive.archlinux.org/packages/d/dialog/dialog-1:1.3_20190211-1-x86_64.pkg.tar.xz", | ||||
"version": "1:1.3_20190211-1", | "version": "1:1.3_20190211-1", | ||||
"length": 180000, | "length": 440, | ||||
"filename": "dialog-1:1.3_20190211-1-x86_64.pkg.tar.xz", | "filename": "dialog-1:1.3_20190211-1-x86_64.pkg.tar.xz", | ||||
"checksums": { | |||||
"length": 440, | |||||
"md5": "ce66c053ded0d51e5610368d85242684", | |||||
"sha256": "27c6a7af005cd2214fd63f7498bf51e3bff332df33a9b8f7ed07934823f7ba43", | |||||
}, | |||||
}, | }, | ||||
{ | { | ||||
"url": "https://archive.archlinux.org/packages/d/dialog/dialog-1:1.3_20220414-1-x86_64.pkg.tar.zst", # noqa: B950 | "url": "https://archive.archlinux.org/packages/d/dialog/dialog-1:1.3_20220414-1-x86_64.pkg.tar.zst", | ||||
"version": "1:1.3_20220414-1", | "version": "1:1.3_20220414-1", | ||||
"length": 198000, | "length": 371, | ||||
"filename": "dialog-1:1.3_20220414-1-x86_64.pkg.tar.zst", | "filename": "dialog-1:1.3_20220414-1-x86_64.pkg.tar.zst", | ||||
"checksums": { | |||||
"length": 371, | |||||
"md5": "5687f6bfc3b6975fdd073deb7075ec09", | |||||
"sha256": "b002d18d1e1f356410f73b08170f0bd52f0d83b37b71ccd938594e7d486c4e8a", | |||||
}, | |||||
}, | }, | ||||
], | ], | ||||
"arch_metadata": [ | "arch_metadata": [ | ||||
{ | { | ||||
"arch": "x86_64", | "arch": "x86_64", | ||||
"repo": "core", | "repo": "core", | ||||
"name": "dialog", | "name": "dialog", | ||||
"version": "1:1.3_20190211-1", | "version": "1:1.3_20190211-1", | ||||
"last_modified": "2019-02-13T08:36:00", | "last_modified": "2019-02-13T08:36:00", | ||||
}, | }, | ||||
{ | { | ||||
"arch": "x86_64", | "arch": "x86_64", | ||||
"repo": "core", | "repo": "core", | ||||
"name": "dialog", | "name": "dialog", | ||||
"version": "1:1.3_20220414-1", | "version": "1:1.3_20220414-1", | ||||
"last_modified": "2022-04-16T03:59:00", | "last_modified": "2022-04-16T03:59:00", | ||||
}, | }, | ||||
], | ], | ||||
}, | }, | ||||
{ | { | ||||
"url": "https://archlinuxarm.org/packages/aarch64/gzip", | "url": "https://archlinuxarm.org/packages/aarch64/gzip", | ||||
"artifacts": [ | "artifacts": [ | ||||
{ | { | ||||
"url": "https://uk.mirror.archlinuxarm.org/aarch64/core/gzip-1.12-1-aarch64.pkg.tar.xz", # noqa: B950 | "url": "https://uk.mirror.archlinuxarm.org/aarch64/core/gzip-1.12-1-aarch64.pkg.tar.xz", | ||||
"length": 79640, | "length": 472, | ||||
"version": "1.12-1", | "version": "1.12-1", | ||||
"filename": "gzip-1.12-1-aarch64.pkg.tar.xz", | "filename": "gzip-1.12-1-aarch64.pkg.tar.xz", | ||||
"checksums": { | |||||
"length": 472, | |||||
"md5": "0b96fa72ae35c097ec78132ed2f05a57", | |||||
"sha256": "8d45b871283e2c37513833f6327ebcdd96c6c3b335588945f873cb809b1e6d2b", | |||||
}, | |||||
} | } | ||||
], | ], | ||||
"arch_metadata": [ | "arch_metadata": [ | ||||
{ | { | ||||
"arch": "aarch64", | "arch": "aarch64", | ||||
"name": "gzip", | "name": "gzip", | ||||
"repo": "core", | "repo": "core", | ||||
"version": "1.12-1", | "version": "1.12-1", | ||||
▲ Show 20 Lines • Show All 184 Lines • Show Last 20 Lines |