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
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
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")