-
Notifications
You must be signed in to change notification settings - Fork 679
/
Copy pathtest_moex.py
33 lines (27 loc) · 927 Bytes
/
test_moex.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import pytest
from requests.exceptions import HTTPError
from pandas_datareader import data as web
pytestmark = pytest.mark.stable
class TestMoex:
def test_moex_datareader(self):
try:
df = web.DataReader(
"USD000UTSTOM", "moex", start="2017-07-01", end="2017-07-31"
)
assert "SECID" in df.columns
except HTTPError as e:
pytest.skip(e)
def test_moex_stock_datareader(self):
try:
df = web.DataReader(
["GAZP", "SIBN"], "moex", start="2019-12-26", end="2019-12-26"
)
assert len(df) == 2
except HTTPError as e:
pytest.skip(e)
def test_moex_datareader_filter(self):
try:
df = web.DataReader("SBER", "moex", start="2020-07-14", end="2020-07-14")
assert len(df) == 1
except HTTPError as e:
pytest.skip(e)