import os
import sys

root = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
sys.path.append(root)

# ----------------------------------------------------------------------------

# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code

# ----------------------------------------------------------------------------
# -*- coding: utf-8 -*-

import ccxt  # noqa: F402
from ccxt.test.exchange.base import test_shared_methods  # noqa E402

def test_filter_by():
    exchange = ccxt.Exchange({
        'id': 'sampleexchange',
    })
    sample_array = [{
    'foo': 'a',
}, {
    'foo': None,
}, {
    'foo': 'b',
}, {
    'foo': 'a',
    'bar': 'b',
}, {
    'foo': 'c',
}, {
    'foo': 'd',
}, {
    'foo': 'b',
}, {
    'foo': 'c',
}, {
    'foo': 'c',
}]
    current_value = exchange.filter_by(sample_array, 'foo', 'a')
    stored_value = [{
    'foo': 'a',
}, {
    'foo': 'a',
    'bar': 'b',
}]
    test_shared_methods.assert_deep_equal(exchange, None, 'testFilterBy', current_value, stored_value)
