Exemple #1
0
 def test_get_metadata(self):
     exp, _assets = asset._get_exposure(self.exposure, stop='assets')
     self.assertEqual(exp.description, 'Exposure model for buildings')
     self.assertIsNone(exp.insurance_limit_is_absolute)
     self.assertIsNone(exp.deductible_is_absolute)
     self.assertEqual([tuple(ct) for ct in exp.cost_types],
                      [('structural', 'per_asset', 'USD')])
Exemple #2
0
def get_cost_calculator(oqparam):
    """
    Read the first lines of the exposure file and infers the cost calculator
    """
    exposure = asset._get_exposure(oqparam.inputs['exposure'], stop='assets')
    return exposure[0].cost_calculator