'Verify that the helpers.cascading_delete() method is working properly'

def test_cascading_delete(self):

    gs_cat = gs_catalog
    shp_file = os.path.join(gisdata.VECTOR_DATA, 'san_andres_y_providencia_poi.shp')
    shp_layer = file_upload(shp_file)
    resource_name = shp_layer.name
    ws = gs_cat.get_workspace(shp_layer.workspace)
    store = gs_cat.get_store(shp_layer.store, ws)
    store_name = store.name
    layer = gs_cat.get_layer(resource_name)
    styles = (layer.styles + [layer.default_style])
    cascading_delete(gs_cat, shp_layer.alternate)
    for style in styles:
        s = gs_cat.get_style(style.name)
        assert (s is None)
    self.assertRaises(FailedRequestError, (lambda : gs_cat.get_resource(resource_name, store=store)))
    self.assertRaises(FailedRequestError, (lambda : gs_cat.get_store(store_name)))
    shp_layer.delete()
