mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
add case [in]sensitivity tests + add OfficialProvider model
`ci` in this context means "Case Insensitive". `cs` in this context means "Case Sensitive". New models created: - OfficialProvider This was required to write a test for checking that OfficialProviders behaves as we expect, which was the starter for the original aurblup bug. New tests created: - test_official_provider Modified tests: - test_package_base: add ci test - test_package: add ci test - test_session: add cs test - test_ssh_pub_key: add cs test Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
parent
e865a6347f
commit
1874e821f5
6 changed files with 167 additions and 0 deletions
|
@ -3,6 +3,8 @@ import pytest
|
|||
from sqlalchemy import and_
|
||||
from sqlalchemy.exc import IntegrityError
|
||||
|
||||
import aurweb.config
|
||||
|
||||
from aurweb.db import create, query
|
||||
from aurweb.models.account_type import AccountType
|
||||
from aurweb.models.package import Package
|
||||
|
@ -55,6 +57,20 @@ def test_package():
|
|||
assert record is not None
|
||||
|
||||
|
||||
def test_package_ci():
|
||||
""" Test case insensitivity of the database table. """
|
||||
if aurweb.config.get("database", "backend") == "sqlite":
|
||||
return None # SQLite doesn't seem handle this.
|
||||
|
||||
from aurweb.db import session
|
||||
|
||||
with pytest.raises(IntegrityError):
|
||||
create(Package,
|
||||
PackageBase=pkgbase,
|
||||
Name="Beautiful-Package")
|
||||
session.rollback()
|
||||
|
||||
|
||||
def test_package_null_pkgbase_raises_exception():
|
||||
from aurweb.db import session
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue