Ejemplo n.º 1
0
def step_impl(context, lid, coords):
    if lid is None:
        context.execute_steps("then at least 1 result is returned")
        bboxes = context.response.property_list('boundingbox')
    else:
        context.execute_steps("then more than {}results are returned".format(lid))
        bboxes = [context.response.result[int(lid)]['boundingbox']]

    expected = Bbox(coords)

    for bbox in bboxes:
        assert bbox in expected, "Bbox {} is not contained in {}.".format(bbox, expected)
Ejemplo n.º 2
0
def step_impl(context, lid, coords):
    if lid is None:
        context.execute_steps("then at least 1 result is returned")
        centroids = zip(context.response.property_list('lon'),
                        context.response.property_list('lat'))
    else:
        context.execute_steps("then more than %sresults are returned".format(lid))
        res = context.response.result[int(lid)]
        centroids = [(res['lon'], res['lat'])]

    expected = Bbox(coords)

    for centroid in centroids:
        assert centroid in expected,\
               "Centroid {} is not inside {}.".format(centroid, expected)