mirror of
https://github.com/arcan1s/ahriman.git
synced 2025-06-28 06:41:43 +00:00
filter empty packages from database
In some cases (e.g. during addition of the package to build queue) we don't have full information about package inself; in these cases we produce lines with empty architecture, which duplicates normal ones. This commit changes architecture column type to required and also filters packages which don't have architecture set yet. Closes #83
This commit is contained in:
@ -0,0 +1,8 @@
|
||||
from ahriman.core.database.migrations.m006_packages_architecture_required import steps
|
||||
|
||||
|
||||
def test_migration_logs() -> None:
|
||||
"""
|
||||
migration must not be empty
|
||||
"""
|
||||
assert steps
|
@ -48,6 +48,16 @@ def test_package_update_insert_packages(database: SQLite, connection: Connection
|
||||
connection.executemany(pytest.helpers.anyvar(str, strict=True), pytest.helpers.anyvar(int))
|
||||
|
||||
|
||||
def test_package_update_insert_packages_no_arch(database: SQLite, connection: Connection,
|
||||
package_ahriman: Package) -> None:
|
||||
"""
|
||||
must skip package insertion if no package architecture set
|
||||
"""
|
||||
package_ahriman.packages[package_ahriman.base].architecture = None
|
||||
database._package_update_insert_packages(connection, package_ahriman)
|
||||
connection.executemany(pytest.helpers.anyvar(str, strict=True), [])
|
||||
|
||||
|
||||
def test_package_update_insert_status(database: SQLite, connection: Connection, package_ahriman: Package) -> None:
|
||||
"""
|
||||
must insert single package status
|
||||
|
Reference in New Issue
Block a user