()
| 16 | from ccxt.test.exchange.base import test_shared_methods # noqa E402 |
| 17 | |
| 18 | def test_unique(): |
| 19 | exchange = ccxt.Exchange({ |
| 20 | 'id': 'sampleexchange', |
| 21 | }) |
| 22 | # in different langs, the order (sort) is not guaranteed, so we sort the results before comparing them |
| 23 | # todo: `unique` is primarily meant for strings atm, add numeric support |
| 24 | test_shared_methods.assert_deep_equal(exchange, None, 'testUnique', exchange.unique([]), []) |
| 25 | # testSharedMethods.assertDeepEqual (exchange, undefined, 'testUnique', exchange.sort (exchange.unique ([ 1, 2, 3 ])), [ 1, 2, 3 ]); |
| 26 | # testSharedMethods.assertDeepEqual (exchange, undefined, 'testUnique', exchange.sort (exchange.unique ([ 1, 2, 3, 4, 1 ])), [ 1, 2, 3, 4 ]); |
| 27 | test_shared_methods.assert_deep_equal(exchange, None, 'testUnique', exchange.sort(exchange.unique(['a', 'a', 'b', 'c', 'a', 'c'])), ['a', 'b', 'c']) |
no test coverage detected
searching dependent graphs…