def verify_organization_service_geofence_locations_from_table(context):
    policy = context.entity_manager.get_current_organization_service_policy()
    for row in context.table:
        geofence = GeoFence(row['Latitude'], row['Longitude'], row['Radius'],
                            row['Name'])
        if geofence not in policy.geofences:
            raise Exception("%s not in policy geofences: %s" %
                            (geofence, policy.geofences))
def verify_current_auth_response_requires_geofence(context, radius, latitude,
                                                   longitude, name):
    current_auth = context.entity_manager.get_current_auth_response()

    geofence = GeoFence(latitude, longitude, radius, name)

    if geofence not in current_auth.auth_policy.geofences:
        raise Exception("%s not in policy geofences: %s" %
                        (geofence, current_auth.auth_policy.geofences))