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
34
aurweb/models/official_provider.py
Normal file
34
aurweb/models/official_provider.py
Normal file
|
@ -0,0 +1,34 @@
|
|||
from sqlalchemy.exc import IntegrityError
|
||||
from sqlalchemy.orm import mapper
|
||||
|
||||
from aurweb.schema import OfficialProviders
|
||||
|
||||
|
||||
class OfficialProvider:
|
||||
def __init__(self,
|
||||
Name: str = None,
|
||||
Repo: str = None,
|
||||
Provides: str = None):
|
||||
self.Name = Name
|
||||
if not self.Name:
|
||||
raise IntegrityError(
|
||||
statement="Column Name cannot be null.",
|
||||
orig="OfficialProviders.Name",
|
||||
params=("NULL"))
|
||||
|
||||
self.Repo = Repo
|
||||
if not self.Repo:
|
||||
raise IntegrityError(
|
||||
statement="Column Repo cannot be null.",
|
||||
orig="OfficialProviders.Repo",
|
||||
params=("NULL"))
|
||||
|
||||
self.Provides = Provides
|
||||
if not self.Provides:
|
||||
raise IntegrityError(
|
||||
statement="Column Provides cannot be null.",
|
||||
orig="OfficialProviders.Provides",
|
||||
params=("NULL"))
|
||||
|
||||
|
||||
mapper(OfficialProvider, OfficialProviders)
|
Loading…
Add table
Add a link
Reference in a new issue