Skip to content

Commit c5ed783

Browse files
authored
Merge pull request corpetty#7 from taylorjdawson/unit-tests
Unit Tests
2 parents 859bfe3 + de0829b commit c5ed783

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44
# Temporary data
55
.ipynb_checkpoints/
66
/examples/stats/.ipynb_checkpoints
7+
/.cache/

tests/__init__.py

Whitespace-only changes.

tests/test_token.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import pytest
2+
3+
from etherscan.tokens import Tokens
4+
5+
DGD_TOKEN_SUPPLY = '1994946756800000'
6+
DGD_TOKEN_BALANCE = '212900000000000'
7+
AP_IKEY = 'YourAPIkey'
8+
TOKEN_NAME = 'DGD'
9+
ADDRESS = '0x4366ddc115d8cf213c564da36e64c8ebaa30cdbd'
10+
API_KEY = 'YourAPIkey'
11+
12+
def test_get_token_supply():
13+
api = Tokens(tokenname=TOKEN_NAME, api_key=(API_KEY))
14+
assert (api.get_total_supply() == DGD_TOKEN_SUPPLY)
15+
16+
def test_get_token_balance():
17+
api = Tokens(tokenname=TOKEN_NAME, api_key=API_KEY)
18+
assert(api.get_token_balance(ADDRESS) == DGD_TOKEN_BALANCE)

0 commit comments

Comments
 (0)