Exemplo n.º 1
0
 def test_get_commission(self):
     qiwi_wallet = Wallet(TOKEN, PROXY, number=NUMBER)
     assert isinstance(qiwi_wallet, Wallet)
     commission = qiwi_wallet.get_commission('26476', qiwi_wallet.proxy)
     assert type(commission) == pyqiwi.types.Commission
     for commission_range in commission.ranges:
         assert type(commission_range) == pyqiwi.types.CommissionRange
Exemplo n.º 2
0
 def test_online_commission(self):
     qiwi_wallet = Wallet(TOKEN, PROXY, number=NUMBER)
     assert isinstance(qiwi_wallet, Wallet)
     commission = qiwi_wallet.get_commission('26476', qiwi_wallet.proxy)
     assert type(commission) == pyqiwi.types.Commission
     saved_range = None
     for commission_range in commission.ranges:
         assert type(commission_range) == pyqiwi.types.CommissionRange
         if commission_range.rate != 1.0 or commission_range.rate != 1:
             saved_range = commission_range
     online_commission = qiwi_wallet.commission('26476', qiwi_wallet.number, 100)
     assert online_commission.qw_commission.amount == 100 * saved_range.rate