mirror of
https://github.com/basicswap/basicswap.git
synced 2025-11-05 18:38:09 +01:00
tests: Run black in CI.
This commit is contained in:
5
.github/workflows/ci.yml
vendored
5
.github/workflows/ci.yml
vendored
@@ -38,7 +38,7 @@ jobs:
|
|||||||
sudo apt-get install -y firefox
|
sudo apt-get install -y firefox
|
||||||
fi
|
fi
|
||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip
|
||||||
pip install flake8 codespell pytest selenium
|
pip install -e .[dev]
|
||||||
pip install -r requirements.txt --require-hashes
|
pip install -r requirements.txt --require-hashes
|
||||||
- name: Install
|
- name: Install
|
||||||
run: |
|
run: |
|
||||||
@@ -52,6 +52,9 @@ jobs:
|
|||||||
- name: Run codespell
|
- name: Run codespell
|
||||||
run: |
|
run: |
|
||||||
codespell --check-filenames --disable-colors --quiet-level=7 --ignore-words=tests/lint/spelling.ignore-words.txt -S .git,.eggs,.tox,pgp,*.pyc,*basicswap/contrib,*basicswap/interface/contrib,*mnemonics.py,bin/install_certifi.py,*basicswap/static
|
codespell --check-filenames --disable-colors --quiet-level=7 --ignore-words=tests/lint/spelling.ignore-words.txt -S .git,.eggs,.tox,pgp,*.pyc,*basicswap/contrib,*basicswap/interface/contrib,*mnemonics.py,bin/install_certifi.py,*basicswap/static
|
||||||
|
- name: Run black
|
||||||
|
run: |
|
||||||
|
black --check --diff --exclude="contrib" .
|
||||||
- name: Run test_other
|
- name: Run test_other
|
||||||
run: |
|
run: |
|
||||||
pytest tests/basicswap/test_other.py
|
pytest tests/basicswap/test_other.py
|
||||||
|
|||||||
@@ -327,9 +327,7 @@ def formatBids(swap_client, bids, filters) -> bytes:
|
|||||||
|
|
||||||
amount_to = None
|
amount_to = None
|
||||||
if ci_to:
|
if ci_to:
|
||||||
amount_to = ci_to.format_amount(
|
amount_to = ci_to.format_amount((b[4] * b[10]) // ci_from.COIN())
|
||||||
(b[4] * b[10]) // ci_from.COIN()
|
|
||||||
)
|
|
||||||
|
|
||||||
bid_data = {
|
bid_data = {
|
||||||
"bid_id": b[2].hex(),
|
"bid_id": b[2].hex(),
|
||||||
@@ -343,14 +341,13 @@ def formatBids(swap_client, bids, filters) -> bytes:
|
|||||||
"bid_rate": swap_client.ci(b[14]).format_amount(b[10]),
|
"bid_rate": swap_client.ci(b[14]).format_amount(b[10]),
|
||||||
"bid_state": strBidState(b[5]),
|
"bid_state": strBidState(b[5]),
|
||||||
"addr_from": b[11],
|
"addr_from": b[11],
|
||||||
"addr_to": offer.addr_to if offer else None
|
"addr_to": offer.addr_to if offer else None,
|
||||||
}
|
}
|
||||||
|
|
||||||
if with_extra_info:
|
if with_extra_info:
|
||||||
bid_data.update({
|
bid_data.update(
|
||||||
"tx_state_a": strTxState(b[7]),
|
{"tx_state_a": strTxState(b[7]), "tx_state_b": strTxState(b[8])}
|
||||||
"tx_state_b": strTxState(b[8])
|
)
|
||||||
})
|
|
||||||
rv.append(bid_data)
|
rv.append(bid_data)
|
||||||
return bytes(json.dumps(rv), "UTF-8")
|
return bytes(json.dumps(rv), "UTF-8")
|
||||||
|
|
||||||
|
|||||||
@@ -151,7 +151,9 @@ def page_bid(self, url_split, post_string):
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def page_bids(self, url_split, post_string, sent=False, available=False, received=False):
|
def page_bids(
|
||||||
|
self, url_split, post_string, sent=False, available=False, received=False
|
||||||
|
):
|
||||||
server = self.server
|
server = self.server
|
||||||
swap_client = server.swap_client
|
swap_client = server.swap_client
|
||||||
swap_client.checkSystemStatus()
|
swap_client.checkSystemStatus()
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ dev = [
|
|||||||
"pip-tools",
|
"pip-tools",
|
||||||
"pytest",
|
"pytest",
|
||||||
"ruff",
|
"ruff",
|
||||||
"black",
|
"black==24.10.0",
|
||||||
"selenium",
|
"selenium",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user