Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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