def testconvertAmountToChips(self): """ Chips amount must be equal or less than min value""" for m in MONEYS: result = money.convertAmountToChips( m['amount'] ) self.assertTrue( abs( m['amount'] - money.convertChipsToAmount( result ) ) < m['min'] )
def testretrieveAmountFromChips(self): for m in MONEYS: for a in AMOUNTS: result = money.retrieveAmountFromChips( a, dict(m['chips']) ) self.assertTrue( abs( a - int(money.convertChipsToAmount( result )) ) < m['min'] )
def testconvertChipsToAmount(self): """Chips amount must be equal to the real amount""" for m in MONEYS: result = money.convertChipsToAmount( m['chips'] ) self.assertTrue( abs( m['amount'] - result ) < m['min'] )