Skip to content

Commit 42ad8fa

Browse files
committed
update push.sh
1 parent 753a867 commit 42ad8fa

File tree

95 files changed

+3400
-350
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+3400
-350
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,10 @@ python/package-lock.json
3030
python/package.json
3131
python/keys.json
3232
python/LICENSE.txt
33+
__pycache__
3334
.env
3435
*.swp
3536
.cache
3637
*.log
3738
*.un~
39+
*.pyc

build/push.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ echo "Pushing generated files back to GitHub..."
3939
LAST_COMMIT_MESSAGE="$(git log --no-merges -1 --pretty=%B)"
4040
git config --global user.email "[email protected]"
4141
git config --global user.name "Travis CI"
42-
git add CHANGELOG.md dist/cjs/**/* dist/ccxt.bundle.cjs dist/ccxt.browser.js dist/ccxt.browser.min.js ts/ccxt.ts ts/src/abstract/*.ts js/**/** php/*.php php/abstract/*.php php/async/*.php php/async/abstract/*.php php/pro/*.php php/test/**/** python/ccxt/test/**/** python/ccxt/async_support/*.py python/ccxt/*.py python/ccxt/pro/*.py python/ccxt/pro/test/**/** python/ccxt/pro/test/exchange/**/** wiki/* examples/py examples/php examples/js
42+
git add CHANGELOG.md dist/cjs/**/* dist/ccxt.bundle.cjs dist/ccxt.browser.js dist/ccxt.browser.min.js ts/ccxt.ts ts/src/abstract/*.ts js/**/** php/*.php php/abstract/*.php php/async/*.php php/async/abstract/*.php php/pro/*.php python/ccxt/async_support/*.py python/ccxt/*.py python/ccxt/pro/*.py wiki/* examples/py examples/php examples/js
43+
git add php/test/ php/pro/test/
44+
git add python/ccxt/test/ python/ccxt/pro/test/
4345
git add -f python/LICENSE.txt python/package.json python/README.md
4446
git commit -a -m "${COMMIT_MESSAGE}" -m '[ci skip]' || exit 0
4547
if [ "$SHOULD_TAG" = "true" ]; then

python/ccxt/test/async/test_fetch_accounts.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# -*- coding: utf-8 -*-
1414

1515

16-
from ccxt.test.base.test_account import test_account # noqa E402
16+
from ccxt.test.base import test_account # noqa E402
1717

1818

1919
async def test_fetch_accounts(exchange):
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import os
2+
import sys
3+
4+
root = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
5+
sys.path.append(root)
6+
7+
# ----------------------------------------------------------------------------
8+
9+
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
10+
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
11+
12+
# ----------------------------------------------------------------------------
13+
# -*- coding: utf-8 -*-
14+
15+
16+
from ccxt.test.base import test_balance # noqa E402
17+
18+
19+
async def test_fetch_balance(exchange, code, symbol):
20+
method = 'fetchBalance'
21+
response = await exchange.fetch_balance()
22+
test_balance(exchange, method, response)
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import os
2+
import sys
3+
4+
root = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
5+
sys.path.append(root)
6+
7+
# ----------------------------------------------------------------------------
8+
9+
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
10+
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
11+
12+
# ----------------------------------------------------------------------------
13+
# -*- coding: utf-8 -*-
14+
15+
16+
from ccxt.test.base import test_borrow_interest # noqa E402
17+
18+
19+
async def test_fetch_borrow_interest(exchange, code, symbol):
20+
method = 'fetchBorrowInterest'
21+
borrow_interest = await exchange.fetch_borrow_interest(code, symbol)
22+
assert isinstance(borrow_interest, list), exchange.id + ' ' + method + ' ' + code + ' must return an array. ' + exchange.json(borrow_interest)
23+
for i in range(0, len(borrow_interest)):
24+
test_borrow_interest(exchange, method, borrow_interest[i], code, symbol)
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import os
2+
import sys
3+
4+
root = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
5+
sys.path.append(root)
6+
7+
# ----------------------------------------------------------------------------
8+
9+
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
10+
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
11+
12+
# ----------------------------------------------------------------------------
13+
# -*- coding: utf-8 -*-
14+
15+
16+
from ccxt.test.base import test_borrow_rate # noqa E402
17+
18+
19+
async def test_fetch_borrow_rate(exchange, code):
20+
method = 'fetchBorrowRate'
21+
borrow_rate = None
22+
try:
23+
borrow_rate = await exchange.fetch_borrow_rate(code)
24+
except Exception as ex:
25+
message = ex.message
26+
# for exchanges, atm, we don't have the correct lists of currencies, which currency is borrowable and which not. So, because of our predetermined list of test-currencies, some of them might not be borrowable, and thus throws exception. However, we shouldn't break tests for that specific exceptions, and skip those occasions.
27+
if message.find('could not find the borrow rate for currency code') < 0:
28+
raise Error(message)
29+
# console.log (method + '() : ' + code + ' is not borrowable for this exchange. Skipping the test method.');
30+
return
31+
test_borrow_rate(exchange, method, borrow_rate, code)
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import os
2+
import sys
3+
4+
root = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
5+
sys.path.append(root)
6+
7+
# ----------------------------------------------------------------------------
8+
9+
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
10+
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
11+
12+
# ----------------------------------------------------------------------------
13+
# -*- coding: utf-8 -*-
14+
15+
16+
from ccxt.test.base import test_borrow_rate # noqa E402
17+
18+
19+
async def test_fetch_borrow_rates(exchange):
20+
method = 'fetchBorrowRates'
21+
borrow_rates = await exchange.fetch_borrow_rates()
22+
assert isinstance(borrow_rates, dict), exchange.id + ' ' + method + ' must return an object. ' + exchange.json(borrow_rates)
23+
values = list(borrow_rates.values())
24+
for i in range(0, len(values)):
25+
test_borrow_rate(exchange, method, values[i], None)
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import os
2+
import sys
3+
4+
root = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
5+
sys.path.append(root)
6+
7+
# ----------------------------------------------------------------------------
8+
9+
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
10+
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
11+
12+
# ----------------------------------------------------------------------------
13+
# -*- coding: utf-8 -*-
14+
15+
16+
from ccxt.test.base import test_order # noqa E402
17+
from ccxt.test.base import test_shared_methods # noqa E402
18+
19+
20+
async def test_fetch_closed_orders(exchange, symbol):
21+
method = 'fetchClosedOrders'
22+
orders = await exchange.fetch_closed_orders(symbol)
23+
assert isinstance(orders, list), exchange.id + ' ' + method + ' must return an array, returned ' + exchange.json(orders)
24+
now = exchange.milliseconds()
25+
for i in range(0, len(orders)):
26+
order = orders[i]
27+
test_order(exchange, method, order, symbol, now)
28+
assert exchange.in_array(order['status'], ['closed', 'canceled']), exchange.id + ' ' + method + ' ' + symbol + ' returned an order with status ' + order['status'] + ' (expected \"closed\" or \"canceled\")'
29+
test_shared_methods.assert_timestamp_order(exchange, method, symbol, orders)
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import os
2+
import sys
3+
4+
root = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
5+
sys.path.append(root)
6+
7+
# ----------------------------------------------------------------------------
8+
9+
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
10+
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
11+
12+
# ----------------------------------------------------------------------------
13+
# -*- coding: utf-8 -*-
14+
15+
16+
from ccxt.test.base import test_currency # noqa E402
17+
18+
19+
async def test_fetch_currencies(exchange):
20+
method = 'fetchCurrencies'
21+
currencies = await exchange.fetch_currencies()
22+
# todo: try to invent something to avoid undefined undefined, i.e. maybe move into private and force it to have a value
23+
if currencies is not None:
24+
values = list(currencies.values())
25+
for i in range(0, len(values)):
26+
test_currency(exchange, method, values[i])
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import os
2+
import sys
3+
4+
root = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
5+
sys.path.append(root)
6+
7+
# ----------------------------------------------------------------------------
8+
9+
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
10+
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
11+
12+
# ----------------------------------------------------------------------------
13+
# -*- coding: utf-8 -*-
14+
15+
16+
from ccxt.test.base import test_shared_methods # noqa E402
17+
from ccxt.test.base import test_transaction # noqa E402
18+
19+
20+
async def test_fetch_deposits_withdrawals(exchange, code):
21+
method = 'fetchTransactions'
22+
transactions = await exchange.fetch_transactions(code)
23+
assert isinstance(transactions, list), exchange.id + ' ' + method + ' ' + code + ' must return an array. ' + exchange.json(transactions)
24+
now = exchange.milliseconds()
25+
for i in range(0, len(transactions)):
26+
test_transaction(exchange, method, transactions[i], code, now)
27+
test_shared_methods.assert_timestamp_order(exchange, method, code, transactions)

0 commit comments

Comments
 (0)