def test_GenerateAssetWeightingAbsolute(self): mod = Model() us = Country(mod, 'US', 'USA') s = Sector(us, 'HH', 'Household') with self.assertRaises(NotImplementedError): s.GenerateAssetWeighting([('BOND', '0.5'), ], 'MON', is_absolute_weighting=True)
def test_GenerateAssetWeightings_1(self): mod = Model() us = Country(mod, 'US', 'USA') s = Sector(us, 'HH', 'Household') s.GenerateAssetWeighting((), 'MON') self.assertEqual('1.0', s.EquationBlock['WGT_MON'].RHS()) self.assertEqual('F*WGT_MON', kill_spaces(s.EquationBlock['DEM_MON'].RHS()))