mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
style: Run pre-commit
This commit is contained in:
parent
b47882b114
commit
9c6c13b78a
235 changed files with 7180 additions and 5628 deletions
|
@ -14,8 +14,13 @@ def setup(db_test):
|
|||
@pytest.fixture
|
||||
def user() -> User:
|
||||
with db.begin():
|
||||
user = db.create(User, Username="test", Email="test@example.org",
|
||||
Passwd="testPassword", AccountTypeID=USER_ID)
|
||||
user = db.create(
|
||||
User,
|
||||
Username="test",
|
||||
Email="test@example.org",
|
||||
Passwd="testPassword",
|
||||
AccountTypeID=USER_ID,
|
||||
)
|
||||
yield user
|
||||
|
||||
|
||||
|
@ -26,11 +31,12 @@ def packages(user: User) -> list[Package]:
|
|||
now = time.utcnow()
|
||||
with db.begin():
|
||||
for i in range(5):
|
||||
pkgbase = db.create(PackageBase, Name=f"pkg_{i}",
|
||||
SubmittedTS=now,
|
||||
ModifiedTS=now)
|
||||
pkg = db.create(Package, PackageBase=pkgbase,
|
||||
Name=f"pkg_{i}", Version=f"{i}.0")
|
||||
pkgbase = db.create(
|
||||
PackageBase, Name=f"pkg_{i}", SubmittedTS=now, ModifiedTS=now
|
||||
)
|
||||
pkg = db.create(
|
||||
Package, PackageBase=pkgbase, Name=f"pkg_{i}", Version=f"{i}.0"
|
||||
)
|
||||
output.append(pkg)
|
||||
yield output
|
||||
|
||||
|
@ -48,7 +54,7 @@ def test_pkgmaint(packages: list[Package]):
|
|||
# Modify the first package so it's out of date and gets deleted.
|
||||
with db.begin():
|
||||
# Reduce SubmittedTS by a day + 10 seconds.
|
||||
packages[0].PackageBase.SubmittedTS -= (86400 + 10)
|
||||
packages[0].PackageBase.SubmittedTS -= 86400 + 10
|
||||
|
||||
# Run pkgmaint.
|
||||
pkgmaint.main()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue