def OnAdd(self, event): if not self.tc1.GetValue() or not self.tc2.GetValue() or not self.tc3.GetValue() or not self.tc5.GetValue(): return self.tc4.Clear() upphaed = int(self.tc1.GetValue()) eign = int(self.tc2.GetValue()) timabil = int(self.tc3.GetValue()) vextir = float(self.tc5.GetValue()) nidurstada = reiknivelar.sparnadar_takmark(upphaed, eign, timabil, vextir) if nidurstada == None: nidurstada = 'Villa' self.tc5.SetForegroundColour(wx.RED) else: self.tc5.SetForegroundColour(wx.BLACK) nidurstada = int(nidurstada) self.tc4.AppendText(str(nidurstada))
def testTwo_sparnadar_takmark(self): self.failUnlessAlmostEqual(reiknivelar.sparnadar_takmark(1000, 2, 23, 22), 0.0, places = 1)
def testOne_sparnadar_takmark(self): self.failUnlessAlmostEqual(reiknivelar.sparnadar_takmark(100000, 2000, 24, 13), 28.0, places = 1)