本文整理匯總了Python中money.Money.franc方法的典型用法代碼示例。如果您正苦於以下問題:Python Money.franc方法的具體用法?Python Money.franc怎麽用?Python Money.franc使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類money.Money
的用法示例。
在下文中一共展示了Money.franc方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: testMixedAddition
# 需要導入模塊: from money import Money [as 別名]
# 或者: from money.Money import franc [as 別名]
def testMixedAddition(self):
fiveBucks = Money.dollar(5)
tenFrancs = Money.franc(10)
bank = Bank()
bank.addRate('CHF', 'USD', 2)
result = bank.reduce(fiveBucks.plus(tenFrancs), 'USD')
self.assertEquals(Money.dollar(10), result)
示例2: testSumTimes
# 需要導入模塊: from money import Money [as 別名]
# 或者: from money.Money import franc [as 別名]
def testSumTimes(self):
fiveBucks = Money.dollar(5)
tenFrancs = Money.franc(10)
bank = Bank()
bank.addRate('CHF', 'USD', 2)
sum = Sum(fiveBucks, tenFrancs).times(2)
result = bank.reduce(sum, 'USD')
self.assertEquals(Money.dollar(20), result)
示例3: testCurrency
# 需要導入模塊: from money import Money [as 別名]
# 或者: from money.Money import franc [as 別名]
def testCurrency(self):
self.assertEquals('USD', Money.dollar(1).currency)
self.assertEquals('CHF', Money.franc(1).currency)
示例4: testReduceMoneyDifferentCurrency
# 需要導入模塊: from money import Money [as 別名]
# 或者: from money.Money import franc [as 別名]
def testReduceMoneyDifferentCurrency(self):
bank = Bank()
bank.addRate('CHF', 'USD', 2)
result = bank.reduce(Money.franc(2), 'USD')
self.assertEquals(Money.dollar(1), result)
示例5: testEquality
# 需要導入模塊: from money import Money [as 別名]
# 或者: from money.Money import franc [as 別名]
def testEquality(self):
self.assertTrue(Money.dollar(5) == Money.dollar(5))
self.assertFalse(Money.dollar(5) == Money.dollar(6))
self.assertFalse(Money.franc(5) == Money.dollar(5))