Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bmoscon committed Jan 7, 2024
1 parent 345d344 commit 3713c23
Show file tree
Hide file tree
Showing 15 changed files with 26 additions and 26 deletions.
16 changes: 8 additions & 8 deletions tests/integration/rest/test_binance.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'''
Copyright (C) 2017-2023 Bryant Moscon - bmoscon@gmail.com
Copyright (C) 2017-2024 Bryant Moscon - bmoscon@gmail.com
Please see the LICENSE file for the terms and conditions
associated with this software.
Expand Down Expand Up @@ -31,7 +31,7 @@ def teardown_module(module):


class TestBinanceRest:
@pytest.mark.xfail(reason="Binance blocks build machine IP ranges. If not in the USA this should pass")
@pytest.mark.xfail(reason="Binance blocks build machine IP ranges. If outside the USA this should pass")
def test_trade(self):
ret = []
for data in b.trades_sync('BTC-USDT'):
Expand All @@ -44,7 +44,7 @@ def test_trade(self):
assert isinstance(ret[0]['amount'], Decimal)
assert isinstance(ret[0]['timestamp'], float)

@pytest.mark.xfail(reason="Binance blocks build machine IP ranges. If not in the USA this should pass")
@pytest.mark.xfail(reason="Binance blocks build machine IP ranges. If outside the USA this should pass")
def test_trades(self):
expected = {'timestamp': 1577836800.594,
'symbol': 'BTC-USDT',
Expand All @@ -61,7 +61,7 @@ def test_trades(self):
assert ret[0] == expected
assert ret[0]['timestamp'] < ret[-1]['timestamp']

@pytest.mark.xfail(reason="Binance blocks build machine IP ranges. If not in the USA this should pass")
@pytest.mark.xfail(reason="Binance blocks build machine IP ranges. If outside the USA this should pass")
def test_candles(self):
expected = Candle(
b.id,
Expand All @@ -85,7 +85,7 @@ def test_candles(self):
assert len(ret) == 1
assert ret[0] == expected

@pytest.mark.xfail(reason="Binance blocks build machine IP ranges. If not in the USA this should pass")
@pytest.mark.xfail(reason="Binance blocks build machine IP ranges. If outside the USA this should pass")
def test_bf_trade(self):
expected = {'timestamp': 1577836801.481,
'symbol': 'BTC-USDT-PERP',
Expand All @@ -102,15 +102,15 @@ def test_bf_trade(self):
assert len(ret) == 3
assert ret[0] == expected

@pytest.mark.xfail(reason="Binance blocks build machine IP ranges. If not in the USA this should pass")
@pytest.mark.xfail(reason="Binance blocks build machine IP ranges. If outside the USA this should pass")
def test_bf_trades(self):
ret = []
for data in bf.trades_sync('BTC-USDT-PERP', start='2020-01-01 00:00:00', end='2020-01-01 1:00:00'):
ret.extend(data)

assert len(ret) == 2588

@pytest.mark.xfail(reason="Binance blocks build machine IP ranges. If not in the USA this should pass")
@pytest.mark.xfail(reason="Binance blocks build machine IP ranges. If outside the USA this should pass")
def test_bd_trade(self):
expected = {'timestamp': 1609459200.567,
'symbol': 'BTC-USD-PERP',
Expand All @@ -127,7 +127,7 @@ def test_bd_trade(self):
assert len(ret) == 2
assert ret[0] == expected

@pytest.mark.xfail(reason="Binance blocks build machine IP ranges. If not in the USA this should pass")
@pytest.mark.xfail(reason="Binance blocks build machine IP ranges. If outside the USA this should pass")
def test_bd_trades(self):
ret = []
for data in bd.trades_sync('BTC-USD-PERP', start='2021-01-01 00:00:00', end='2021-01-01 1:00:00'):
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/rest/test_bitfinex.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'''
Copyright (C) 2017-2023 Bryant Moscon - bmoscon@gmail.com
Copyright (C) 2017-2024 Bryant Moscon - bmoscon@gmail.com
Please see the LICENSE file for the terms and conditions
associated with this software.
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/rest/test_bitmex.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'''
Copyright (C) 2017-2023 Bryant Moscon - bmoscon@gmail.com
Copyright (C) 2017-2024 Bryant Moscon - bmoscon@gmail.com
Please see the LICENSE file for the terms and conditions
associated with this software.
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/rest/test_coinbase.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'''
Copyright (C) 2017-2023 Bryant Moscon - bmoscon@gmail.com
Copyright (C) 2017-2024 Bryant Moscon - bmoscon@gmail.com
Please see the LICENSE file for the terms and conditions
associated with this software.
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/rest/test_deribit.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'''
Copyright (C) 2017-2023 Bryant Moscon - bmoscon@gmail.com
Copyright (C) 2017-2024 Bryant Moscon - bmoscon@gmail.com
Please see the LICENSE file for the terms and conditions
associated with this software.
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/rest/test_dydx.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'''
Copyright (C) 2017-2023 Bryant Moscon - bmoscon@gmail.com
Copyright (C) 2017-2024 Bryant Moscon - bmoscon@gmail.com
Please see the LICENSE file for the terms and conditions
associated with this software.
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/rest/test_gemini.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'''
Copyright (C) 2017-2023 Bryant Moscon - bmoscon@gmail.com
Copyright (C) 2017-2024 Bryant Moscon - bmoscon@gmail.com
Please see the LICENSE file for the terms and conditions
associated with this software.
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/rest/test_kraken.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'''
Copyright (C) 2017-2023 Bryant Moscon - bmoscon@gmail.com
Copyright (C) 2017-2024 Bryant Moscon - bmoscon@gmail.com
Please see the LICENSE file for the terms and conditions
associated with this software.
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/rest/test_okx.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'''
Copyright (C) 2017-2023 Bryant Moscon - bmoscon@gmail.com
Copyright (C) 2017-2024 Bryant Moscon - bmoscon@gmail.com
Please see the LICENSE file for the terms and conditions
associated with this software.
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/test_binance.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'''
Copyright (C) 2017-2023 Bryant Moscon - bmoscon@gmail.com
Copyright (C) 2017-2024 Bryant Moscon - bmoscon@gmail.com
Please see the LICENSE file for the terms and conditions
associated with this software.
Expand All @@ -11,7 +11,7 @@
from cryptofeed.exchanges import Binance


@pytest.mark.xfail(reason="Binance blocks build machine IP ranges. If not in the USA this should pass")
@pytest.mark.xfail(reason="Binance blocks build machine IP ranges. If outside the USA this should pass")
def test_binance_address_generation():
symbols = Binance.symbols()
channels = [channel for channel in Binance.info()['channels']['websocket'] if not Binance.is_authenticated_channel(channel)]
Expand Down
8 changes: 4 additions & 4 deletions tests/unit/test_exchange.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'''
Copyright (C) 2017-2023 Bryant Moscon - bmoscon@gmail.com
Copyright (C) 2017-2024 Bryant Moscon - bmoscon@gmail.com
Please see the LICENSE file for the terms and conditions
associated with this software.
Expand All @@ -9,7 +9,7 @@

import pytest

from cryptofeed.defines import ASCENDEX, ASCENDEX_FUTURES, BEQUANT, BITDOTCOM, BITGET, BITHUMB, CANDLES, BINANCE, BINANCE_DELIVERY, CRYPTODOTCOM, DELTA, FMFW, BITFINEX, DYDX, EXX, BINANCE_FUTURES, BINANCE_US, BITFLYER, BITMEX, BITSTAMP, BITTREX, BLOCKCHAIN, COINBASE, DERIBIT, GATEIO, GEMINI, HITBTC, HUOBI, HUOBI_DM, HUOBI_SWAP, INDEPENDENT_RESERVE, KRAKEN, KRAKEN_FUTURES, KUCOIN, L3_BOOK, OKCOIN, OKX, PHEMEX, POLONIEX, PROBIT, TICKER, TRADES, L2_BOOK, BYBIT, UPBIT, BINANCE_TR, GATEIO_FUTURES
from cryptofeed.defines import ASCENDEX, ASCENDEX_FUTURES, BEQUANT, BITDOTCOM, BITGET, BITHUMB, CANDLES, BINANCE, BINANCE_DELIVERY, CRYPTODOTCOM, DELTA, FMFW, BITFINEX, DYDX, EXX, BINANCE_FUTURES, BINANCE_US, BITFLYER, BITMEX, BITSTAMP, BLOCKCHAIN, COINBASE, DERIBIT, GATEIO, GEMINI, HITBTC, HUOBI, HUOBI_DM, HUOBI_SWAP, INDEPENDENT_RESERVE, KRAKEN, KRAKEN_FUTURES, KUCOIN, L3_BOOK, OKCOIN, OKX, PHEMEX, POLONIEX, PROBIT, TICKER, TRADES, L2_BOOK, BYBIT, UPBIT, BINANCE_TR, GATEIO_FUTURES
from cryptofeed.exchanges import EXCHANGE_MAP
from cryptofeed.raw_data_collection import playback
from cryptofeed.symbols import Symbols
Expand All @@ -30,11 +30,11 @@
BITFLYER: {L2_BOOK: 749, TICKER: 249, TRADES: 162},
ASCENDEX: {L2_BOOK: 279, TRADES: 4},
ASCENDEX_FUTURES: {L2_BOOK: 261, TRADES: 12},
BITDOTCOM: {L2_BOOK: 46, TICKER: 61},
BITDOTCOM: {L2_BOOK: 1042, TICKER: 124, TRADES: 6},
BITGET: {CANDLES: 10060, L2_BOOK: 637, TICKER: 345, TRADES: 555},
BITMEX: {L2_BOOK: 1979, TICKER: 436, TRADES: 27},
BITSTAMP: {TRADES: 10, L2_BOOK: 627},
BITTREX: {TICKER: 162, CANDLES: 20, L2_BOOK: 1014},
#BITTREX: {TICKER: 162, CANDLES: 20, L2_BOOK: 1014},
BLOCKCHAIN: {L2_BOOK: 78},
BYBIT: {TRADES: 251, L2_BOOK: 4278},
COINBASE: {L2_BOOK: 9729, TICKER: 107, TRADES: 107},
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_exchange_integration.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'''
Copyright (C) 2017-2023 Bryant Moscon - bmoscon@gmail.com
Copyright (C) 2017-2024 Bryant Moscon - bmoscon@gmail.com
Please see the LICENSE file for the terms and conditions
associated with this software.
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_serialization.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'''
Copyright (C) 2017-2023 Bryant Moscon - bmoscon@gmail.com
Copyright (C) 2017-2024 Bryant Moscon - bmoscon@gmail.com
Please see the LICENSE file for the terms and conditions
associated with this software.
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_symbol_normalization.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'''
Copyright (C) 2017-2023 Bryant Moscon - bmoscon@gmail.com
Copyright (C) 2017-2024 Bryant Moscon - bmoscon@gmail.com
Please see the LICENSE file for the terms and conditions
associated with this software.
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'''
Copyright (C) 2017-2023 Bryant Moscon - bmoscon@gmail.com
Copyright (C) 2017-2024 Bryant Moscon - bmoscon@gmail.com
Please see the LICENSE file for the terms and conditions
associated with this software.
Expand Down

0 comments on commit 3713c23

Please sign in to comment.