-
-
Notifications
You must be signed in to change notification settings - Fork 248
Expand file tree
/
Copy pathtest_token.py
More file actions
executable file
·24 lines (17 loc) · 779 Bytes
/
test_token.py
File metadata and controls
executable file
·24 lines (17 loc) · 779 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import unittest
import warnings
from etherscan.tokens import Tokens
ELCOIN_TOKEN_SUPPLY = '21265524714464'
ELCOIN_TOKEN_BALANCE = "135499"
CONTRACT_ADDRESS = '0x57d90b64a1a57749b0f932f1a3395792e12e7055'
ADDRESS = '0xe04f27eb70e025b78871a2ad7eabe85e61212761'
API_KEY = 'YourAPIkey'
class TokensTestCase(unittest.TestCase):
def setUp(self):
warnings.simplefilter('ignore', ResourceWarning)
def test_get_token_supply(self):
api = Tokens(contract_address=CONTRACT_ADDRESS, api_key=(API_KEY))
self.assertEqual(api.get_total_supply(), ELCOIN_TOKEN_SUPPLY)
def test_get_token_balance(self):
api = Tokens(contract_address=CONTRACT_ADDRESS, api_key=API_KEY)
self.assertEqual(api.get_token_balance(ADDRESS), ELCOIN_TOKEN_BALANCE)