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
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
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'
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
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