Skip to content

Commit

Permalink
Fix base account test, patch version
Browse files Browse the repository at this point in the history
  • Loading branch information
sndmndss committed Aug 28, 2024
1 parent 3ed9e70 commit 7b672eb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "bpx-py"
version = "1.2.0"
version = "1.2.1"
description = "Backpack API SDK tool"
authors = ["sndmndss <[email protected]>"]
readme = "README.md"
Expand Down
28 changes: 14 additions & 14 deletions tests/test_base_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ def test_initialization(account):


def test_get_balances(account):
url, headers = account.get_balances(window=10000)
assert url == "https://api.backpack.exchange/api/v1/capital"
assert "X-API-Key" in headers
request_config = account.get_balances(window=10000)
assert request_config.url == "https://api.backpack.exchange/api/v1/capital"
assert "X-API-Key" in request_config.headers


def test_get_deposits(account):
Expand All @@ -38,21 +38,21 @@ def test_get_deposits(account):
with pytest.raises(NegativeValueError):
account.get_deposits(limit=100, offset=-1, window=10000)

url, headers, params = account.get_deposits(limit=100, offset=0, window=10000)
assert url == "https://api.backpack.exchange/wapi/v1/capital/deposits"
assert params["limit"] == 100
assert params["offset"] == 0
request_config = account.get_deposits(limit=100, offset=0, window=10000)
assert request_config.url == "https://api.backpack.exchange/wapi/v1/capital/deposits"
assert request_config.params["limit"] == 100
assert request_config.params["offset"] == 0


def test_get_deposit_address(account):
with pytest.raises(InvalidBlockchainValue):
account.get_deposit_address(blockchain="invalid_blockchain", window=10000)

url, headers, params = account.get_deposit_address(
request_config = account.get_deposit_address(
blockchain="Bitcoin", window=10000
)
assert url == "https://api.backpack.exchange/wapi/v1/capital/deposit/address"
assert params["blockchain"] == "Bitcoin"
assert request_config.url == "https://api.backpack.exchange/wapi/v1/capital/deposit/address"
assert request_config.params["blockchain"] == "Bitcoin"


def test_signing(account):
Expand All @@ -72,13 +72,13 @@ def test_withdrawal(account):
window=10000,
)

url, headers, params = account.withdrawal(
request_config = account.withdrawal(
address="1BitcoinAddress",
symbol="BTC",
blockchain="Bitcoin",
quantity="1.0",
window=10000,
)
assert url == "https://api.backpack.exchange/wapi/v1/capital/withdrawals"
assert params["address"] == "1BitcoinAddress"
assert params["blockchain"] == "Bitcoin"
assert request_config.url == "https://api.backpack.exchange/wapi/v1/capital/withdrawals"
assert request_config.params["address"] == "1BitcoinAddress"
assert request_config.params["blockchain"] == "Bitcoin"

0 comments on commit 7b672eb

Please sign in to comment.