-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add basic smoke tests for the data layer
- Loading branch information
1 parent
25c1c87
commit ed672b3
Showing
4 changed files
with
40 additions
and
6 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import pytest | ||
|
||
from dotenv import load_dotenv | ||
load_dotenv(".env.example") | ||
|
||
from bots.settings import TOKEN_ADDRESS, STABLE_TOKEN_ADDRESS | ||
from bots.data import Token, Price | ||
|
||
@pytest.mark.asyncio | ||
async def test_get_by_token_address(): | ||
t = await Token.get_by_token_address(TOKEN_ADDRESS) | ||
assert t.token_address == TOKEN_ADDRESS | ||
assert t.listed == True | ||
|
||
@pytest.mark.asyncio | ||
async def test_get_prices(): | ||
prices = await Price.get_prices([await Token.get_by_token_address(TOKEN_ADDRESS)]) | ||
assert len(prices) == 1 | ||
[price] = prices | ||
assert price.pretty_price != 0 |