'Verify that layer is correctly deleted from GeoServer'

def test_layer_delete_from_geoserver(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, overwrite=True)
    ws = gs_cat.get_workspace(shp_layer.workspace)
    shp_store = gs_cat.get_store(shp_layer.store, ws)
    shp_store_name = shp_store.name
    shp_layer.delete()
    self.assertRaises(FailedRequestError, (lambda : gs_cat.get_store(shp_store_name)))
    tif_file = os.path.join(gisdata.RASTER_DATA, 'test_grid.tif')
    tif_layer = file_upload(tif_file)
    ws = gs_cat.get_workspace(tif_layer.workspace)
    tif_store = gs_cat.get_store(tif_layer.store, ws)
    tif_layer.delete()
    self.assertRaises(FailedRequestError, (lambda : gs_cat.get_resource(shp_layer.name, store=tif_store)))
