def test_exposures_for_layer(self): """Test for exposures_for_layer""" exposures = exposures_for_layer('polygon') expected = [ exposure_structure, exposure_population, exposure_land_cover, ] self.assertItemsEqual(exposures, expected) exposures = exposures_for_layer('line') expected = [exposure_road] self.assertItemsEqual(exposures, expected)
def test_exposures_for_layer(self): """Test for exposures_for_layer""" exposures = exposures_for_layer('polygon') expected = [ exposure_structure, exposure_population, exposure_land_cover, ] self.assertItemsEqual(exposures, expected) exposures = exposures_for_layer('line') expected = [exposure_road] self.assertItemsEqual(exposures, expected)
def test_exposures_for_layer(self): """Test for exposures_for_layer""" exposures = exposures_for_layer('polygon') expected = [ exposure_structure, exposure_population, exposure_land_cover, ] self.assertEqual(dict_values_sorted(exposures), dict_values_sorted(expected)) exposures = exposures_for_layer('line') expected = [ exposure_road, exposure_structure, ] self.assertEqual(exposures, expected)
def test_exposures_for_layer(self): """Test for exposures_for_layer""" exposures = exposures_for_layer('polygon') expected = [ exposure_structure, exposure_population, exposure_land_cover, ] self.assertEqual(dict_values_sorted(exposures), dict_values_sorted(expected)) exposures = exposures_for_layer('line') expected = [ exposure_road, exposure_structure, ] self.assertEqual(exposures, expected)
def subcategories_for_layer(self): """Return a list of valid subcategories for a layer. Subcategory is hazard type or exposure type. :returns: A list where each value represents a valid subcategory. :rtype: list """ purpose = self.parent.step_kw_purpose.selected_purpose() layer_geometry_key = self.parent.get_layer_geometry_key() if purpose == layer_purpose_hazard: return hazards_for_layer(layer_geometry_key) elif purpose == layer_purpose_exposure: return exposures_for_layer(layer_geometry_key)
def subcategories_for_layer(self): """Return a list of valid subcategories for a layer. Subcategory is hazard type or exposure type. :returns: A list where each value represents a valid subcategory. :rtype: list """ purpose = self.parent.step_kw_purpose.selected_purpose() layer_geometry_key = self.parent.get_layer_geometry_key() if purpose == layer_purpose_hazard: return hazards_for_layer(layer_geometry_key) elif purpose == layer_purpose_exposure: return exposures_for_layer(layer_geometry_key)