def test_AddTerm(self): mod = Model() us = Country(mod, 'US', 'USA! USA!') s = Sector(us, 'SEC', 'Desc') s.AddVariable('SUP_GOOD', 'Supply of goods', '') s.AddTermToEquation('SUP_GOOD', 'Kaboom') self.assertEqual('Kaboom', s.EquationBlock['SUP_GOOD'].RHS())
def test_AddTerm_KeyError(self): mod = Model() us = Country(mod, 'US', 'USA! USA!') s = Sector(us, 'SEC', 'Desc') with self.assertRaises(KeyError): s.AddTermToEquation('SUP', 'x')