def test_ddpa_insert_valid_dmg_state(self):
     for ds in self.DMG_STATES:
         dd = models.DmgDistPerAssetData(
             dmg_dist_per_asset=self.ddpa, exposure_data=self.exp_data,
             dmg_state=ds, mean=0.0, stddev=0.0,
             location=self.GRID_CELL_SITE.point.to_wkt())
         dd.save()
    def test_ddpa_update_invalid_dmg_state(self):
        dd = models.DmgDistPerAssetData(
            dmg_dist_per_asset=self.ddpa, exposure_data=self.exp_data,
            dmg_state='slight', mean=0.0, stddev=0.0,
            location=self.GRID_CELL_SITE.point.to_wkt())
        dd.save()

        self._test_insert_update_invalid(dd, 'dmg_dist_per_asset_data')
示例#3
0
    def make_data(self, asset, dmg_state, mean, stddev):
        data = models.DmgDistPerAssetData(
            dmg_dist_per_asset=self.dda,
            exposure_data=asset,
            dmg_state=dmg_state,
            mean=mean,
            stddev=stddev,
            location=asset.site)

        data.save()
        self.data.append(data)