mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
23 lines
559 B
Python
23 lines
559 B
Python
import pytest
|
|
|
|
from sqlalchemy.exc import IntegrityError
|
|
|
|
from aurweb import db
|
|
from aurweb.models.package_blacklist import PackageBlacklist
|
|
|
|
|
|
@pytest.fixture(autouse=True)
|
|
def setup(db_test):
|
|
return
|
|
|
|
|
|
def test_package_blacklist_creation():
|
|
with db.begin():
|
|
package_blacklist = db.create(PackageBlacklist, Name="evil-package")
|
|
assert bool(package_blacklist.ID)
|
|
assert package_blacklist.Name == "evil-package"
|
|
|
|
|
|
def test_package_blacklist_null_name_raises_exception():
|
|
with pytest.raises(IntegrityError):
|
|
PackageBlacklist()
|