Example #1
0
def point_space_id():
    """Create shared XYZ space with Chicago Parks data."""
    api = HubApi(credentials=XYZ_TOKEN)
    # setup, create temporary space
    res = api.post_space(
        data={
            "title": "Testing xyzspaces",
            "description": "Temporary space containing Chicago Parks data",
        })
    space_id = res["id"]
    gj_chicago_parks = get_chicago_parks_data()
    sleep(0.5)
    api.put_space_features(space_id=space_id, data=gj_chicago_parks)
    yield space_id

    # now teardown (delete temporary space)
    api.delete_space(space_id=space_id)
Example #2
0
def space_id():
    """Create shared XYZ space with countries data as a pytest fixture."""
    api = HubApi(credentials=XYZ_TOKEN)

    # setup, create temporary space
    res = api.post_space(
        data={
            "title": "Testing xyzspaces",
            "description": "Temporary space containing countries data.",
        })
    space_id = res["id"]

    # add features to space
    gj_countries = get_countries_data()
    sleep(0.5)
    api.put_space_features(space_id=space_id, data=gj_countries)

    yield space_id

    # now teardown (delete temporary space)
    api.delete_space(space_id=space_id)