當前位置: 首頁>>代碼示例>>Python>>正文


Python Money.yen方法代碼示例

本文整理匯總了Python中money.Money.yen方法的典型用法代碼示例。如果您正苦於以下問題:Python Money.yen方法的具體用法?Python Money.yen怎麽用?Python Money.yen使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在money.Money的用法示例。


在下文中一共展示了Money.yen方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_return_the_sum_of_two_same_nationality_money

# 需要導入模塊: from money import Money [as 別名]
# 或者: from money.Money import yen [as 別名]
    def test_return_the_sum_of_two_same_nationality_money(self):
        money_yen1 = Money.yen(10)
        money_yen2 = Money.yen(5)

        expected = Money.yen(15)
        money_sum = money_yen1 + money_yen2
        self.assertTrue(expected == money_sum)
開發者ID:Phantom-Bridage,項目名稱:lovely-hotel,代碼行數:9,代碼來源:test_money.py

示例2: test_return_the_difference_between_the_two_same_nationality_money

# 需要導入模塊: from money import Money [as 別名]
# 或者: from money.Money import yen [as 別名]
    def test_return_the_difference_between_the_two_same_nationality_money(self):
        money_yen1 = Money.yen(20)
        money_yen2 = Money.yen(5)

        expected = Money.yen(15)
        money_diff = money_yen1 - money_yen2
        self.assertTrue(expected == money_diff)
開發者ID:Phantom-Bridage,項目名稱:lovely-hotel,代碼行數:9,代碼來源:test_money.py

示例3: test_return_the_sum_of_two_different_nationality_money

# 需要導入模塊: from money import Money [as 別名]
# 或者: from money.Money import yen [as 別名]
    def test_return_the_sum_of_two_different_nationality_money(self):
        money_yen = Money.yen(10)
        money_yen.set_exchanger(DummyExchanger())
        money_dollar = Money.dollar(5)

        expected = Money.yen(12.5)
        money_sum = money_yen + money_dollar
        self.assertTrue(expected == money_sum)
開發者ID:Phantom-Bridage,項目名稱:lovely-hotel,代碼行數:10,代碼來源:test_money.py

示例4: test_return_the_difference_between_the_different_nationality_money

# 需要導入模塊: from money import Money [as 別名]
# 或者: from money.Money import yen [as 別名]
    def test_return_the_difference_between_the_different_nationality_money(self):
        money_yen = Money.yen(10)
        money_yen.set_exchanger(DummyExchanger())
        money_dollar = Money.dollar(2)

        expected = Money.yen(9)
        money_diff = money_yen - money_dollar
        self.assertTrue(expected == money_diff)
開發者ID:Phantom-Bridage,項目名稱:lovely-hotel,代碼行數:10,代碼來源:test_money.py

示例5: test_less_equal_with_two_different_nationality_money

# 需要導入模塊: from money import Money [as 別名]
# 或者: from money.Money import yen [as 別名]
    def test_less_equal_with_two_different_nationality_money(self):
        greatest = Money.dollar(20.1)
        median = Money.yen(10)
        median.set_exchanger(DummyExchanger())
        least = Money.dollar(19.9)

        self.check_less_operator_of_rich_comparison(median.__le__, greatest, median, least, True)
開發者ID:Phantom-Bridage,項目名稱:lovely-hotel,代碼行數:9,代碼來源:test_money.py

示例6: test_return_the_money_that_aligned_the_unit_to_currency_of_each_nationality

# 需要導入模塊: from money import Money [as 別名]
# 或者: from money.Money import yen [as 別名]
    def test_return_the_money_that_aligned_the_unit_to_currency_of_each_nationality(self):
        money_yen = Money.yen(10.2)
        expected = (10, 0)
        self.assertTrue(expected == money_yen.currency())

        money_dollar = Money.dollar(10.2)
        expected = (10, 20)
        self.assertTrue(expected == money_dollar.currency())
開發者ID:Phantom-Bridage,項目名稱:lovely-hotel,代碼行數:10,代碼來源:test_money.py

示例7: test_money_exchange_yen_to_dollar

# 需要導入模塊: from money import Money [as 別名]
# 或者: from money.Money import yen [as 別名]
    def test_money_exchange_yen_to_dollar(self):
        money = Money.yen(10)
        money.set_exchanger(DummyExchanger())

        expected = Money.dollar(20)
        result_money = money.exchange("dollar")

        self.assertTrue(expected == result_money)
開發者ID:Phantom-Bridage,項目名稱:lovely-hotel,代碼行數:10,代碼來源:test_money.py

示例8: test_return_error_which_remainder_divide_money_by_except_numbers

# 需要導入模塊: from money import Money [as 別名]
# 或者: from money.Money import yen [as 別名]
 def test_return_error_which_remainder_divide_money_by_except_numbers(self):
     money = Money.yen(10)
     self.check_unexpected_type_as_number(money.__mod__)
開發者ID:Phantom-Bridage,項目名稱:lovely-hotel,代碼行數:5,代碼來源:test_money.py

示例9: test_greater_than_with_two_same_nationality_money

# 需要導入模塊: from money import Money [as 別名]
# 或者: from money.Money import yen [as 別名]
    def test_greater_than_with_two_same_nationality_money(self):
        greatest = Money.yen(11)
        median = Money.yen(10)
        least = Money.yen(9)

        self.check_greater_operator_of_rich_comparison(median.__gt__, greatest, median, least, False)
開發者ID:Phantom-Bridage,項目名稱:lovely-hotel,代碼行數:8,代碼來源:test_money.py

示例10: test_money_recognize_non_equivalent_money_is_not_equal

# 需要導入模塊: from money import Money [as 別名]
# 或者: from money.Money import yen [as 別名]
 def test_money_recognize_non_equivalent_money_is_not_equal(self):
     money_yen1 = Money.yen(10)
     money_yen2 = Money.yen(20)
     money_dollar = Money.dollar(10)
     self.assertFalse(money_yen1 == money_yen2)
     self.assertFalse(money_yen1 == money_dollar)
開發者ID:Phantom-Bridage,項目名稱:lovely-hotel,代碼行數:8,代碼來源:test_money.py

示例11: test_money_recognize_equivalent_money_is_equal

# 需要導入模塊: from money import Money [as 別名]
# 或者: from money.Money import yen [as 別名]
 def test_money_recognize_equivalent_money_is_equal(self):
     money_yen1 = Money.yen(10)
     money_yen2 = Money.yen(10)
     self.assertTrue(money_yen1 == money_yen2)
開發者ID:Phantom-Bridage,項目名稱:lovely-hotel,代碼行數:6,代碼來源:test_money.py

示例12: test_return_the_remainder_divide_money_by_numbers

# 需要導入模塊: from money import Money [as 別名]
# 或者: from money.Money import yen [as 別名]
    def test_return_the_remainder_divide_money_by_numbers(self):
        money = Money.yen(10)

        money_remain = money % 3
        expected = Money.yen(1)
        self.assertTrue(expected == money_remain)
開發者ID:Phantom-Bridage,項目名稱:lovely-hotel,代碼行數:8,代碼來源:test_money.py

示例13: test_return_error_which_product_money_and_except_numbers

# 需要導入模塊: from money import Money [as 別名]
# 或者: from money.Money import yen [as 別名]
 def test_return_error_which_product_money_and_except_numbers(self):
     money = Money.yen(10)
     self.check_unexpected_type_as_number(money.__mul__)
開發者ID:Phantom-Bridage,項目名稱:lovely-hotel,代碼行數:5,代碼來源:test_money.py

示例14: test_return_error_which_sub_money_and_other_class

# 需要導入模塊: from money import Money [as 別名]
# 或者: from money.Money import yen [as 別名]
 def test_return_error_which_sub_money_and_other_class(self):
     money = Money.yen(10)
     self.check_unexpected_type_as_number(money.__sub__)
開發者ID:Phantom-Bridage,項目名稱:lovely-hotel,代碼行數:5,代碼來源:test_money.py

示例15: test_greater_than_with_money_and_real_number

# 需要導入模塊: from money import Money [as 別名]
# 或者: from money.Money import yen [as 別名]
    def test_greater_than_with_money_and_real_number(self):
        greatest = 10.1
        median = Money.yen(10)
        least = 9.9

        self.check_greater_operator_of_rich_comparison(median.__gt__, greatest, median.value, least, False)
開發者ID:Phantom-Bridage,項目名稱:lovely-hotel,代碼行數:8,代碼來源:test_money.py


注:本文中的money.Money.yen方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。