예제 #1
0
def test_delete_provider(db_session, providers):
    provider = db_session.query(CloudProvider).filter_by(
        name="provider_a").first()
    assert provider.name == "provider_a"
    adm.delete_provider(db_session, "provider_a")
    provider = db_session.query(CloudProvider).filter_by(
        name="provider_a").first()
    assert provider == None
예제 #2
0
def delete_cloud_provider(providername):
    """
    Deletes a cloud provider from the userdatamodel
    All projects associated with it should be deassociated
    or removed.
    Returns a json object.
    """
    response = jsonify(admin.delete_provider(current_session, providername))
    return response
예제 #3
0
def test_delete_inexistentprovider(db_session, providers):
    provider = db_session.query(CloudProvider).filter_by(
        name="provider_c").first()
    assert provider == None
    with pytest.raises(NotFound):
        adm.delete_provider(db_session, "provider_c")