Skip to content

Commit

Permalink
Update tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
nessshon committed Dec 18, 2024
1 parent 953b0c7 commit f1b67d0
Show file tree
Hide file tree
Showing 34 changed files with 31 additions and 494 deletions.
11 changes: 11 additions & 0 deletions tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from unittest import IsolatedAsyncioTestCase

from pytonapi import AsyncTonapi

API_KEY = "" # noqa


class TestAsyncTonapi(IsolatedAsyncioTestCase):

def setUp(self) -> None:
self.tonapi = AsyncTonapi(api_key=API_KEY, debug=True)
11 changes: 0 additions & 11 deletions tests/async_tonapi/__init__.py

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from pytonapi import schema
from tests.async_tonapi import TestAsyncTonapi
from tests import TestAsyncTonapi

ACCOUNT_ID = "EQCD39VS5jcptHL8vMjEXrzGaRcCVYto7HUn4bpAOg8xqB2N" # noqa
EVENT_ID = "53388440417dc044d00e99d89b591acc28f100332a004f180e4f14b876620c13"
Expand All @@ -9,10 +9,6 @@

class TestAccountMethod(TestAsyncTonapi):

async def test_parse_address(self):
response = await self.tonapi.accounts.parse_address(ACCOUNT_ID)
self.assertIsInstance(response, schema.accounts.AddressForm)

async def test_get_info(self):
response = await self.tonapi.accounts.get_info(ACCOUNT_ID)
self.assertIsInstance(response, schema.accounts.Account)
Expand Down Expand Up @@ -45,10 +41,6 @@ async def test_get_nfts(self):
response = await self.tonapi.accounts.get_nfts(ACCOUNT_ID)
self.assertIsInstance(response, schema.nft.NftItems)

async def test_get_all_nfts(self):
response = await self.tonapi.accounts.get_all_nfts(ACCOUNT_ID)
self.assertIsInstance(response, schema.nft.NftItems)

async def test_get_traces(self):
response = await self.tonapi.accounts.get_traces(ACCOUNT_ID)
self.assertIsInstance(response, schema.traces.TraceIds)
Expand Down Expand Up @@ -87,4 +79,4 @@ async def test_get_balance_change(self):

async def test_reindex(self):
response = await self.tonapi.accounts.reindex(ACCOUNT_ID)
self.assertIsInstance(response, bool)
self.assertIs(response, None)
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from pytonapi import schema
from tests.async_tonapi import TestAsyncTonapi
from tests import TestAsyncTonapi

BLOCK_ID = "(-1,8000000000000000,4234234)"
ACCOUNT_ID = "EQBR6UVvw1tFcLkxWapnSQ10QH7JWt1fGUesX_C8lqWbluLL" # noqa
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from pytonapi import schema
from tests.async_tonapi import TestAsyncTonapi
from tests import TestAsyncTonapi

DOMAIN_NAME = "foundation.ton"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from pytonapi import schema
from tests.async_tonapi import TestAsyncTonapi
from tests import TestAsyncTonapi

EVENT_ID_HEX = "53388440417dc044d00e99d89b591acc28f100332a004f180e4f14b876620c13"
EVENT_ID_BASE64 = "5J+GJo3uSr36MjOwjYY+2NzYM7pvnm0WzNQktG8czbM=" # noqa
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from pytonapi import schema
from tests.async_tonapi import TestAsyncTonapi
from tests import TestAsyncTonapi

ACCOUNT_ID = "UQCpfwmPKWkNZ7fpzKrLpJjHzzgo97ABM1kzLN6nHdP2DZQr" # noqa

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from pytonapi import schema
from tests.async_tonapi import TestAsyncTonapi
from tests import TestAsyncTonapi

ACCOUNT_ID = "EQBCFwW8uFUh-amdRmNY9NyeDEaeDYXd9ggJGsicpqVcHq7B" # noqa
EVENT_ID = "68656e74d18b10309e41e057191abcfc42f973c82bc84326985cdbf7bf89b126"
Expand All @@ -15,10 +15,6 @@ async def test_get_holders(self):
response = await self.tonapi.jettons.get_holders(ACCOUNT_ID)
self.assertIsInstance(response, schema.jettons.JettonHolders)

async def test_get_all_holders(self):
response = await self.tonapi.jettons.get_all_holders(ACCOUNT_ID)
self.assertIsInstance(response, schema.jettons.JettonHolders)

async def test_get_all_jettons(self):
response = await self.tonapi.jettons.get_all_jettons()
self.assertIsInstance(response, schema.jettons.Jettons)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from pytonapi import schema
from tests.async_tonapi import TestAsyncTonapi
from tests import TestAsyncTonapi

ACCOUNT_ID = "EQCqFPpSLtcstURtrXLRCv9wyjfrw7_44_nwvD8JiSmSjbUI"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from pytonapi import schema
from tests.async_tonapi import TestAsyncTonapi
from tests import TestAsyncTonapi

ACCOUNT_ID_COLLECTION = "EQAG2BH0JlmFkbMrLEnyn2bIITaOSssd4WdisE4BdFMkZbir" # noqa
ACCOUNT_ID_NFT = "EQBSZKEvqoiuPUCFz-CHtpVxAwg1F8PyjZhWAJL2yeujn0_H" # noqa
Expand All @@ -24,10 +24,6 @@ async def test_get_items_by_collection_address(self):
response = await self.tonapi.nft.get_items_by_collection_address(ACCOUNT_ID_COLLECTION)
self.assertIsInstance(response, schema.nft.NftItems)

async def test_get_all_items_by_collection_address(self):
response = await self.tonapi.nft.get_all_items_by_collection_address(ACCOUNT_ID_COLLECTION)
self.assertIsInstance(response, schema.nft.NftItems)

async def test_get_item_by_address(self):
response = await self.tonapi.nft.get_item_by_address(ACCOUNT_ID_NFT)
self.assertIsInstance(response, schema.nft.NftItem)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from pytonapi import schema
from tests.async_tonapi import TestAsyncTonapi
from tests import TestAsyncTonapi

TOKEN = "EQBCFwW8uFUh-amdRmNY9NyeDEaeDYXd9ggJGsicpqVcHq7B" # noqa
TOKENS = ["TON"]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from pprint import pprint

from tests.async_tonapi import TestAsyncTonapi
from tests import TestAsyncTonapi

ACCOUNT_ID = "EQChB2eMoFG4ThuEsZ6ehlBPKJXOjNxlR5B7qKZNGIv256Da"
ACCOUNTS_IDS = ["ALL"]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from pytonapi import schema
from tests.async_tonapi import TestAsyncTonapi
from tests import TestAsyncTonapi

ACCOUNT_ID = "EQCMVd9ya3yvhyhOWckBUmrHsle3eLqb_em8npZEmbbR-NOe" # noqa
POOL_ID = "EQCOj4wEjXUR59Kq0KeXUJouY5iAcujkmwJGsYX7qPnITEAM" # noqa
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from pytonapi import schema
from tests.async_tonapi import TestAsyncTonapi
from tests import TestAsyncTonapi


class TestStorageMethod(TestAsyncTonapi):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from pytonapi import schema
from tests.async_tonapi import TestAsyncTonapi
from tests import TestAsyncTonapi

STATE_INIT = "?"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from pytonapi import schema
from tests.async_tonapi import TestAsyncTonapi
from tests import TestAsyncTonapi

TRACE_ID_HEX = "97264395BD65A255A429B11326C84128B7D70FFED7949ABAE3036D506BA38621"
TRACE_ID_BASE64 = "VdUG1YMbYqrinFDR4QR7j5CfGQ2O75m34bvxUKvmn00=" # noqa
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from pytonapi import schema
from tests.async_tonapi import TestAsyncTonapi
from tests import TestAsyncTonapi

ACCOUNT_ID = "EQCD39VS5jcptHL8vMjEXrzGaRcCVYto7HUn4bpAOg8xqB2N" # noqa

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from pprint import pprint

from tests.async_tonapi import TestAsyncTonapi
from tests import TestAsyncTonapi

ACCOUNT_ID = "Ef8zMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzM0vF"
ACCOUNTS_IDS = ["UQCFJEP4WZ_mpdo0_kMEmsTgvrMHG7K_tWY16pQhKHwoOtFz"]
Expand All @@ -13,10 +13,10 @@ async def handler(event) -> None:
class TestSSEMethod(TestAsyncTonapi):

async def test_subscribe_to_transactions(self):
await self.tonapi.websocket.subscribe_to_transactions(handler, ACCOUNTS_IDS)
await self.tonapi.websocket.subscribe_to_transactions(ACCOUNTS_IDS, handler)

async def test_subscribe_to_traces(self):
await self.tonapi.websocket.subscribe_to_traces(handler, ACCOUNTS_IDS)
await self.tonapi.websocket.subscribe_to_traces(ACCOUNTS_IDS, handler)

async def test_subscribe_to_mempool(self):
await self.tonapi.websocket.subscribe_to_mempool(handler, [ACCOUNT_ID])
await self.tonapi.websocket.subscribe_to_mempool(ACCOUNTS_IDS, handler)
11 changes: 0 additions & 11 deletions tests/tonapi/__init__.py

This file was deleted.

90 changes: 0 additions & 90 deletions tests/tonapi/test_accounts_methods.py

This file was deleted.

81 changes: 0 additions & 81 deletions tests/tonapi/test_blockchain_methods.py

This file was deleted.

Loading

0 comments on commit f1b67d0

Please sign in to comment.