Exemple #1
0
def test_app_package_link():
    app = App.create(steamid='6', kind='game')
    pkg0 = Package.create(steamid='6')
    pkg1 = Package.create(steamid='7')

    pkg0.link(app)
    pkg1.link(app)

    assert pkg0 in app.packages
    assert pkg1 in app.packages
    assert app in pkg0.apps
    assert app in pkg1.apps
Exemple #2
0
def test_app_create():
    app = App.create(steamid='1',
                     kind='game',
                     enabled=False,
                     name='The Name',
                     threshold=1000)
    assert app.id is not None
    assert app.steamid == '1'
    assert app.kind == 'game'
    assert not app.enabled
    assert app.name == 'The Name'
    assert app.threshold == 1000
Exemple #3
0
def test_app_package_link():
    app = App.create(steamid='6', kind='game')
    pkg0 = Package.create(steamid='6')
    pkg1 = Package.create(steamid='7')

    pkg0.link(app)
    pkg1.link(app)

    assert pkg0 in app.packages
    assert pkg1 in app.packages
    assert app in pkg0.apps
    assert app in pkg1.apps
Exemple #4
0
def test_app_integrity():
    App.create(steamid='3', kind='game')
    with pytest.raises(IntegrityError):
        App.create(steamid='3', kind='game')

    with pytest.raises(IntegrityError):
        App.create(steamid='4')  # missing 'kind'
Exemple #5
0
def test_app_integrity():
    App.create(steamid='3', kind='game')
    with pytest.raises(IntegrityError):
        App.create(steamid='3', kind='game')

    with pytest.raises(IntegrityError):
        App.create(steamid='4')  # missing 'kind'
Exemple #6
0
def test_app_create():
    app = App.create(
        steamid='1',
        kind='game',
        enabled=False,
        name='The Name',
        threshold=1000
    )
    assert app.id is not None
    assert app.steamid == '1'
    assert app.kind == 'game'
    assert not app.enabled
    assert app.name == 'The Name'
    assert app.threshold == 1000
Exemple #7
0
def test_app_package_create():
    app = App.create(steamid='5', kind='game')
    pkg = Package.create(steamid='5')
    app_pkg = AppPackage.create(app=app, package=pkg)
    assert app_pkg.app.id == app.id
    assert app_pkg.package.id == pkg.id
Exemple #8
0
def test_app_package_create():
    app = App.create(steamid='5', kind='game')
    pkg = Package.create(steamid='5')
    app_pkg = AppPackage.create(app=app, package=pkg)
    assert app_pkg.app.id == app.id
    assert app_pkg.package.id == pkg.id