本文整理汇总了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)
示例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)
示例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)
示例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)
示例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)
示例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())
示例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)
示例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__)
示例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)
示例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)
示例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)
示例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)
示例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__)
示例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__)
示例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)