-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sample data bucket and better testing
- Loading branch information
Jan Škoda
committed
Oct 9, 2022
1 parent
1b02e9e
commit 26e83ea
Showing
5 changed files
with
40 additions
and
14 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -4,4 4,4 @@ | |
__email__ = "[email protected]" | ||
__version__ = "0.1.0" | ||
|
||
from .main import load_data # noqa | ||
from .main import load_data, set_default_bucket, use_sample_data # noqa |
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 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 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 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 |
---|---|---|
@@ -1,11 1,25 @@ | ||
#!/usr/bin/env python | ||
|
||
"""Tests for `lakeapi` package.""" | ||
import datetime | ||
|
||
import pytest # noqa | ||
|
||
import lakeapi # noqa | ||
|
||
|
||
def test_empty(): | ||
pass | ||
@pytest.fixture | ||
def candles(): | ||
lakeapi.use_sample_data() | ||
return lakeapi.load_data( | ||
table = 'candles', | ||
symbols = ['BTC-USDT'], | ||
exchanges = ['BINANCE'], | ||
start = datetime.datetime(2022, 8, 28), | ||
end = datetime.datetime(2022, 8, 30), | ||
) | ||
|
||
def test_load_data_loads_something(candles): | ||
assert candles.shape[0] == 2 * 24 * 60 | ||
|
||
def test_load_data_dtypes(candles): | ||
print(candles.dtypes) | ||
assert 'str' not in set(candles.dtypes) | ||
assert str(candles.symbol.dtype) == 'category' |