示例#1
0
 def test_upcharge_at_min_minus_one_cent(self):
     actual = upcharge_card(PAYIN_CARD_MIN - D('0.01'))
     expected = upcharge_card(PAYIN_CARD_MIN)
     assert actual == expected
示例#2
0
 def test_upcharge_at_min(self):
     actual = upcharge_card(PAYIN_CARD_MIN)
     expected = (D('15.54'), D('0.54'), D('0.08'))
     assert actual == expected
     assert actual[1] / actual[0] < D('0.035')  # less than 3.5% fee
示例#3
0
 def test_upcharge_at_target(self):
     actual = upcharge_card(PAYIN_CARD_TARGET)
     expected = (D('94.19'), D('2.19'), D('0.32'))
     assert actual == expected
     assert actual[1] / actual[0] < D('0.024')  # less than 2.4% fee
示例#4
0
 def test_upcharge_basically_works(self):
     actual = upcharge_card(D('20.00'))
     expected = (D('20.65'), D('0.65'), D('0.10'))
     assert actual == expected
示例#5
0
 def test_upcharge_full_in_rounded_case(self):
     actual = upcharge_card(D('5.00'))
     expected = upcharge_card(PAYIN_CARD_MIN)
     assert actual == expected
示例#6
0
 def test_upcharge_at_min_minus_one_cent(self):
     actual = upcharge_card(PAYIN_CARD_MIN - D('0.01'))
     expected = upcharge_card(PAYIN_CARD_MIN)
     assert actual == expected
示例#7
0
 def test_upcharge_at_target(self):
     actual = upcharge_card(PAYIN_CARD_TARGET)
     expected = (D('94.19'), D('2.19'), D('0.32'))
     assert actual == expected
     assert actual[1] / actual[0] < D('0.024')  # less than 2.4% fee
示例#8
0
 def test_upcharge_at_min(self):
     actual = upcharge_card(PAYIN_CARD_MIN)
     expected = (D('15.54'), D('0.54'), D('0.08'))
     assert actual == expected
     assert actual[1] / actual[0] < D('0.035')  # less than 3.5% fee
示例#9
0
 def test_upcharge_full_in_rounded_case(self):
     actual = upcharge_card(D('5.00'))
     expected = upcharge_card(PAYIN_CARD_MIN)
     assert actual == expected
示例#10
0
 def test_upcharge_basically_works(self):
     actual = upcharge_card(D('20.00'))
     expected = (D('20.65'), D('0.65'), D('0.10'))
     assert actual == expected