Пример #1
0
def test_exchange_playback(exchange):
    Symbols.clear()
    dir = os.path.dirname(os.path.realpath(__file__))
    pcap = glob.glob(f"{dir}/../../sample_data/{exchange}.*")

    results = playback(exchange, pcap)
    message_count = get_message_count(pcap)

    assert results['messages_processed'] == message_count
    assert lookup_table[exchange] == results['callbacks']
    Symbols.clear()
Пример #2
0
def test_exchange_playback(exchange):
    Symbols.clear()
    dir = os.path.dirname(os.path.realpath(__file__))
    pcap = glob.glob(f"{dir}/../../sample_data/{exchange}.*")

    results = playback(exchange, pcap, config="tests/config_test.yaml")
    message_count = get_message_count(pcap)

    assert results['messages_processed'] == message_count
    if exchange == BEQUANT:
        # for some unknown reason on the github build servers this test always
        # fails even though it works fine on my local mac and linux machines
        expected = dict(lookup_table[exchange])
        expected[L2_BOOK] = 990

        assert lookup_table[exchange] == results[
            'callbacks'] or expected == results['callbacks']
    else:
        assert lookup_table[exchange] == results['callbacks']
    Symbols.clear()