Exemplo n.º 1
0
 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())
Exemplo n.º 2
0
 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')