Skip to content
This repository has been archived by the owner on Dec 12, 2021. It is now read-only.

Commit

Permalink
Fix test to reflect prior commit
Browse files Browse the repository at this point in the history
  • Loading branch information
shanefontaine committed Dec 29, 2018
1 parent 3f72a0b commit 0d6a61c
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions tests/test_public_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,16 @@ class TestPublicClient(object):
def teardown_method():
time.sleep(.5) # Avoid rate limit

@pytest.mark.skip
def test_get_platform_status(self, client):
r = client.get_platform_status()
assert type(r) is list

@pytest.mark.skip
@pytest.mark.parametrize('pair', ['tBTCUSD', 'tETHBTC'])
def test_get_ticker(self, client, pair):
r = client.get_ticker(pair)
assert type(r) is list
assert len(r) is 10

@pytest.mark.skip
@pytest.mark.parametrize('pair, limit, start, end, sort', [
('tBTCUSD', 120, None, None, 0),
('tBTCUSD', 120, 1514764800000, 1514765700000, 0),
Expand Down Expand Up @@ -58,7 +55,6 @@ def test_get_trades(self, client, pair, limit, start, end, sort):
else:
assert r[0][1] >= r[1][1]

@pytest.mark.skip
@pytest.mark.parametrize('pair, precision, length', [
('tBTCUSD', 'P0', None),
('tBTCUSD', 'P0', 25),
Expand Down Expand Up @@ -102,7 +98,6 @@ def test_get_books(self, client, pair, precision, length):
elif precision == 'R0':
assert len(price == 11)

@pytest.mark.skip
@pytest.mark.parametrize('symbol, key, side, section, sort', [
('fUSD', 'funding.size', 'long', 'hist', 0),
('fUSD', 'credits.size', 'long', 'hist', 0),
Expand All @@ -128,7 +123,7 @@ def test_get_stats(self, client, symbol, key, side, section, sort):
if sort == 1 and section == 'hist':
assert r[0][0] <= r[1][0]
elif sort != 1 and section == 'hist':
assert r[0][1] >= r[1][1]
assert r[0][0] >= r[1][0]

@pytest.mark.parametrize('symbol, time_frame, section, limit, start, end, sort', [
('tBTCUSD', '1m', 'hist', None, None, None, None),
Expand All @@ -138,16 +133,16 @@ def test_get_stats(self, client, symbol, key, side, section, sort):
('tBTCUSD', '15m', 'hist', 1, 1514764800000, 1514768400000, 1),
('tBTCUSD', '1m', 'last', None, None, None, None),
('tBTCUSD', '15m', 'last', 1, 1514764800000, 1514768400000, 1),
('tBTCUSD', '1m', 'last', 1, 1514768400000, 1514764800000, 1),
pytest.param(None, None, None, None, None, None, None,
marks=pytest.mark.xfail),
pytest.param('tBTCUSD', '1m', 'last', 1, 1514764800000, 1514768400000, 1,
pytest.param('tBTCUSD', '1m', 'hist', 1, 1514768400000, 1514764800000, 1,
marks=pytest.mark.xfail)
])
def test_get_candles(self, client, symbol, time_frame, section, limit,
start, end, sort):
r = client.get_candles(symbol, time_frame, section, limit,
start, end, sort)

# Check length
if section == 'hist' and limit != 1:
assert len(r) == 120
Expand All @@ -163,4 +158,4 @@ def test_get_candles(self, client, symbol, time_frame, section, limit,
if sort == 1 and section == 'hist' and limit != 1:
assert r[0][0] <= r[1][0]
elif sort != 1 and section == 'hist' and limit != 1:
assert r[0][1] >= r[1][1]
assert r[0][0] >= r[1][0]

0 comments on commit 0d6a61c

Please sign in to comment.