コード例 #1
0
def test_package_comment_creation(user: User, pkgbase: PackageBase):
    with db.begin():
        package_comment = db.create(PackageComment, PackageBase=pkgbase,
                                    User=user, Comments="Test comment.",
                                    RenderedComment="Test rendered comment.")
    assert bool(package_comment.ID)
コード例 #2
0
def test_package_comment_null_renderedcomment_defaults(user: User,
                                                       pkgbase: PackageBase):
    with db.begin():
        record = db.create(PackageComment, PackageBase=pkgbase,
                           User=user, Comments="Test comment.")
    assert record.RenderedComment == str()
コード例 #3
0
def pkgbase(user: User) -> PackageBase:
    with db.begin():
        pkgbase = db.create(PackageBase, Name="test-package", Maintainer=user)
    yield pkgbase
コード例 #4
0
def user() -> User:
    with db.begin():
        user = db.create(User, Username="******", Email="*****@*****.**",
                         RealName="Test User", Passwd="testPassword",
                         AccountTypeID=USER_ID)
    yield user
コード例 #5
0
def package(user: User, license: License):
    with db.begin():
        pkgbase = db.create(PackageBase, Name="test-package", Maintainer=user)
        package = db.create(Package, PackageBase=pkgbase, Name=pkgbase.Name)
    yield package
コード例 #6
0
def license() -> License:
    with db.begin():
        license = db.create(License, Name="Test License")
    yield license
コード例 #7
0
def test_api_rate_key_ip_default():
    with db.begin():
        api_rate_limit = db.create(ApiRateLimit, Requests=10, WindowStart=1)
    assert api_rate_limit.IP == str()