def OnAdd(self, event): if not self.tc1.GetValue() or not self.tc2.GetValue() or not self.tc3.GetValue(): return self.tc4.Clear() eign = int(self.tc1.GetValue()) timabil = int(self.tc2.GetValue()) vextir = float(self.tc3.GetValue()) nidurstada = reiknivelar.framtidarvirdi(eign, timabil, vextir) if nidurstada == None: nidurstada = 'Villa' self.tc4.SetForegroundColour(wx.RED) else: self.tc4.SetForegroundColour(wx.BLACK) nidurstada = int(nidurstada) self.tc4.AppendText(str(nidurstada))
def testTwo_framtidarvirdi(self): self.failUnlessAlmostEqual(reiknivelar.framtidarvirdi(240000, 13, 45), 30060435.7, places = 1 )
def testOne_framtidarvirdi(self): self.failUnlessAlmostEqual(reiknivelar.framtidarvirdi(100000, 10, 12), 310584.8, places = 1)