Skip to content

Commit

Permalink
remove some data
Browse files Browse the repository at this point in the history
  • Loading branch information
GLEF1X committed Apr 26, 2021
1 parent 1305227 commit b549b2a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 20 deletions.
1 change: 0 additions & 1 deletion glQiwiApi/qiwi/qiwi_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
Account,
Balance,
Identification,
Response,
Sum,
Commission,
OptionalSum,
Expand Down
37 changes: 18 additions & 19 deletions tests/qiwi_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
from glQiwiApi import QiwiWrapper, types, sync, RequestError, InvalidData
from glQiwiApi.core import AioTestCase

TOKEN = '4cb242f9ead43bd0e1e98eb7c442262f'
WALLET = '+380968317459'
QIWI_SECRET = 'eyJ2ZXJzaW9uIjoiUDJQIiwiZGF0YSI6eyJwYXlpbl9tZXJjaGFudF9zaXRlX3VpZCI6ImJuMXZmNy0wMCIsInVzZXJfaWQiOiIzODA5NjgzMTc0NTkiLCJzZWNyZXQiOiI2ZmVjYzA4ZWEyOTgxMDY3N2VkNDU1YjY3MTVhZjc3ZjRhMjY4Yzc5MDU0ZGI2ZmYyZTEzZjI1Njk5ODQ3M2ZmIn19'
TOKEN = 'token'
WALLET = '+number'
QIWI_SECRET = 'p2p token'


class SyncQiwiTestCase(unittest.TestCase):
Expand All @@ -20,11 +20,11 @@ def test_account_info(self):
self.assertTrue(isinstance(info, types.QiwiAccountInfo))

def test_commission(self) -> None:
commission = sync(self.wallet.commission, to_account='+380985272064',
commission = sync(self.wallet.commission, to_account='+number',
pay_sum=1)
self.assertTrue(isinstance(commission, types.Commission))
with self.assertRaises(RequestError):
sync(self.wallet.commission, to_account='+380985272064',
sync(self.wallet.commission, to_account='+number',
pay_sum=-1)

def test_fail(self):
Expand All @@ -36,10 +36,10 @@ def test_fail(self):
end_date=datetime.datetime.now()
)
with self.assertRaises(RequestError):
sync(self.wallet.to_wallet, to_number='+38056546456454',
sync(self.wallet.to_wallet, to_number='+wrong_number',
trans_sum=1)
with self.assertRaises(RequestError):
sync(self.wallet.to_wallet, to_number='+380985272064',
sync(self.wallet.to_wallet, to_number='+number',
trans_sum=-1)

def test_transactions_history(self):
Expand All @@ -64,12 +64,11 @@ def test_transaction_info(self):
self.wallet.transaction_info,
info[0].transaction_id,
info[0].type
)
, types.Transaction)
), types.Transaction)
)

def test_to_wallet(self):
txn_id = sync(self.wallet.to_wallet, to_number='+380985272064',
txn_id = sync(self.wallet.to_wallet, to_number='+number',
trans_sum=1)
self.assertTrue(isinstance(txn_id, str))

Expand Down Expand Up @@ -105,11 +104,11 @@ def test_available_balances(self):
)

def test_to_card(self):
txn_id = sync(self.wallet.to_card, to_card='4890494688391549',
txn_id = sync(self.wallet.to_card, to_card='card_number',
trans_sum=1)
self.assertTrue(isinstance(txn_id, str))
with self.assertRaises(RequestError):
sync(self.wallet.to_card, to_card='+380985272064', trans_sum=1)
sync(self.wallet.to_card, to_card='+wrong_number', trans_sum=1)

def test_test_limits(self):
limits = sync(self.wallet.get_limits)
Expand Down Expand Up @@ -146,12 +145,12 @@ async def test_account_info(self):

async def test_commission(self) -> None:
async with self.wallet as w:
commission = await (w.commission(to_account='+380985272064',
commission = await (w.commission(to_account='+number',
pay_sum=1))
self.assertTrue(isinstance(commission, types.Commission))
with self.assertRaises(RequestError):
async with self.wallet as w:
await w.commission(to_account='+380985272064',
await w.commission(to_account='+number',
pay_sum=-1)

async def test_fail(self):
Expand All @@ -168,7 +167,7 @@ async def test_fail(self):
trans_sum=1)
with self.assertRaises(RequestError):
async with self.wallet as w:
await w.to_wallet(to_number='+380985272064',
await w.to_wallet(to_number='+number',
trans_sum=-1)

async def test_transactions_history(self):
Expand Down Expand Up @@ -201,7 +200,7 @@ async def test_transaction_info(self):

async def test_to_wallet(self):
async with self.wallet as w:
txn_id = await w.to_wallet(to_number='+380985272064',
txn_id = await w.to_wallet(to_number='+number',
trans_sum=1)
self.assertTrue(isinstance(txn_id, str))

Expand All @@ -222,7 +221,7 @@ async def test_p2p_creation(self):
async def test_p2p_status_check(self):
async with self.wallet as w:
bill = await w.create_p2p_bill(amount=1,
comment='my_comment')
comment='my_comment')
checked = await bill.check()
status = await self.wallet.check_p2p_bill_status(
bill_id=bill.bill_id
Expand All @@ -245,8 +244,8 @@ async def test_available_balances(self):

async def test_to_card(self):
async with self.wallet as w:
txn_id = await w.to_card(to_card='4890494688391549',
trans_sum=1)
txn_id = await w.to_card(to_card='card',
trans_sum=1)
with self.assertRaises(RequestError):
txn_id = await w.to_card(to_card='+380985272064',
trans_sum=1)
Expand Down

0 comments on commit b549b2a

Please sign in to comment.