def test_cons_calc_upper_div0(self): cdi = ComponentDataItem(parent=None, ui_setup=None, o=self.m.c8) cdi.calculate() # the ui lists the upper and lower attributes as ub and lb # this was originally so I could easily combine variables and # constarints in the same view, but I split them up, so may want # to reconsider that choise in the future. This is to remind myself # why I'm getting "ub" and not "upper" self.assertEqual(cdi.get("ub"), "Divide_by_0")
def test_cons_calc_upper_div0(self): cdi = ComponentDataItem(parent=None, ui_setup=None, o=self.m.c8) cdi.calculate() # the ui lists the upper and lower attributes as ub and lb # this was originally so I could easily combine variables and # constarints in the same view, but I split them up, so may want # to reconsider that choise in the future. This is to remind myself # why I'm getting "ub" and not "upper" self.assertEqual(cdi.get("ub"), "Divide_by_0")
def test_cons_calc_log_neg(self): cdi = ComponentDataItem(parent=None, ui_setup=None, o=self.m.c6) cdi.calculate() self.assertIsNone(cdi.get("value"))
def test_cons_calc_div0(self): cdi = ComponentDataItem(parent=None, ui_setup=None, o=self.m.c4) cdi.calculate() self.assertEqual(cdi.get("value"), "Divide_by_0")
def test_cons_calc(self): cdi = ComponentDataItem(parent=None, ui_setup=None, o=self.m.c3) cdi.calculate() self.assertAlmostEqual(cdi.get("residual"), 2)
def test_expr_calc_value_None(self): cdi = ComponentDataItem(parent=None, ui_setup=None, o=self.m.b1.e3) cdi.calculate() self.assertIsNone(cdi.get("value"))
def test_expr_calc(self): cdi = ComponentDataItem(parent=None, ui_setup=None, o=self.m.b1.e1) cdi.calculate() self.assertAlmostEqual(cdi.get("value"), 3)
def test_cons_calc_log_neg(self): cdi = ComponentDataItem(parent=None, ui_setup=None, o=self.m.c6) cdi.calculate() self.assertIsNone(cdi.get("value"))
def test_cons_calc_div0(self): cdi = ComponentDataItem(parent=None, ui_setup=None, o=self.m.c4) cdi.calculate() self.assertEqual(cdi.get("value"), "Divide_by_0")
def test_cons_calc(self): cdi = ComponentDataItem(parent=None, ui_setup=None, o=self.m.c3) cdi.calculate() self.assertAlmostEqual(cdi.get("residual"), 2)
def test_expr_calc_value_None(self): cdi = ComponentDataItem(parent=None, ui_setup=None, o=self.m.b1.e3) cdi.calculate() self.assertIsNone(cdi.get("value"))
def test_expr_calc(self): cdi = ComponentDataItem(parent=None, ui_setup=None, o=self.m.b1.e1) cdi.calculate() self.assertAlmostEqual(cdi.get("value"), 3)
def test_cons_calc(self): cdi = ComponentDataItem(parent=None, ui_setup=None, o=self.m.c3) cdi.calculate() assert(abs(cdi.get("residual") - 2) < 0.0001)
def test_expr_calc(self): cdi = ComponentDataItem(parent=None, ui_setup=None, o=self.m.b1.e1) cdi.calculate() assert(abs(cdi.get("value")-3) < 0.0001)