Exemplo n.º 1
0
def test_create_packages_from_channeldata(dao, user, local_channel, db):
    channeldata = json.loads(channeldata_json)
    create_packages_from_channeldata(local_channel.name, user.id, channeldata, dao)

    package = db.query(Package).filter(Package.name == "other-package").one()

    assert package
    assert package.summary == "dummy package"
Exemplo n.º 2
0
def test_create_packages_from_channeldata_update_existing(
        dao, dummy_user, local_channel, db, local_package):
    # update exisiting package

    channeldata = json.loads(channeldata_json)

    create_packages_from_channeldata(local_channel.name, dummy_user.id,
                                     channeldata, dao)

    package = db.query(Package).filter(Package.name == "other-package").one()

    assert package

    assert package.description == "descriptive description"
    assert package.summary == "dummy package"
    assert package.url == "https://palletsprojects.com/p/click/"
    assert package.platforms == "linux-64:osx"
    assert json.loads(package.channeldata)["summary"] == "dummy package"

    # need to clean up manually due to auto_rollback=False option
    db.delete(package)
    db.commit()