Skip to content

Commit 25207f2

Browse files
committed
python: tests: fix linter issues
1 parent 1cc7c43 commit 25207f2

File tree

7 files changed

+6
-9
lines changed

7 files changed

+6
-9
lines changed

src/test/test_aes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def test_aes_cbc(self):
9393
self.assertEqual(h(out_buf), h(o))
9494

9595
def test_aes_cbc_with_ecdh_key(self):
96-
ENCRYPT, DECRYPT, PUBKEY_LEN, _ = 1, 2, 33, True
96+
ENCRYPT, DECRYPT, _ = 1, 2, True
9797
a_priv = make_cbuffer('1c6a837d1ac663fdc7f1002327ca38452766eaf4fe3b80ce620bf7cd3f584cf6')[0]
9898
a_pub = make_cbuffer('03e581be89d1ef8ce11d60746d08e4f8aedf934d1d861dd436042ee2e3b16db918')[0]
9999
b_priv = make_cbuffer('0b6b3dc90d203d854100110788ac87d43aa00620c9cdb361b281b09022ef4b53')[0]

src/test/test_anti_exfil.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def test_anti_exfil(self):
1616

1717
flags = FLAG_ECDSA
1818

19-
ret = wally_ec_public_key_from_private_key(priv_key, 32, pub_key, 33);
19+
ret = wally_ec_public_key_from_private_key(priv_key, 32, pub_key, 33)
2020
self.assertEqual(WALLY_OK, ret)
2121

2222
ret = wally_ae_host_commit_from_bytes(entropy, 32, flags, host_commitment, 32)

src/test/test_elements.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ def test_blinding(self):
202202
SCALAR_OFFSET_LEN = 32
203203
offset, offset_len = make_cbuffer('00' * SCALAR_OFFSET_LEN)
204204
ret = wally_asset_scalar_offset(value, UNBLINDED_ABF, UNBLINDED_ABF_LEN,
205-
UNBLINDED_VBF, UNBLINDED_VBF_LEN, offset, offset_len);
205+
UNBLINDED_VBF, UNBLINDED_VBF_LEN, offset, offset_len)
206206
self.assertEqual(ret, WALLY_OK)
207207
self.assertEqual(h(offset),
208208
utf8('4e5f3ca8aa2048eeacc8c300e3d63ca92048f407264352bee2fb15bd44349c45'))

src/test/test_map.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ def test_map(self):
162162
self.assertEqual(wally_map_find(clone, new_key, new_key_len), (WALLY_OK, 0))
163163

164164
# Re-create clone to test combining
165-
self.assertEqual(wally_map_free(clone), WALLY_OK);
165+
self.assertEqual(wally_map_free(clone), WALLY_OK)
166166
self.assertEqual(wally_map_init_alloc(0, None, clone), WALLY_OK)
167167
self.assertEqual(wally_map_add(clone, new_key, new_key_len, v, vl), WALLY_OK)
168168

@@ -246,7 +246,7 @@ def test_keypath_map(self):
246246
self.assertEqual(wally_map_add(m, bip32, bip32_len, kp_path, len(kp_path)), WALLY_OK)
247247

248248
# Fingerprint/Path
249-
out, out_len = (c_ubyte * (FP_LEN + 5 * 4))(), 24
249+
out = (c_ubyte * (FP_LEN + 5 * 4))()
250250
cases = [
251251
(None, 0, out, FP_LEN), # NULL key
252252
(m, 1, out, FP_LEN), # Bad index
@@ -255,7 +255,6 @@ def test_keypath_map(self):
255255
]
256256
for args in cases:
257257
self.assertEqual(wally_map_keypath_get_item_fingerprint(*args), WALLY_EINVAL)
258-
plen = out_len - 4 if args[3] == FP_LEN else out_len - 5
259258
if args[0] is None or args[1] != 0:
260259
ret = wally_map_keypath_get_item_path_len(args[0], args[1])
261260
self.assertEqual(ret, (WALLY_EINVAL, 0))

src/test/test_sign.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ def test_invalid_inputs(self):
188188
(priv_key, len(priv_key), out_buf, 10)] # Wrong out len
189189

190190
for pk, pk_len, o, o_len in cases:
191-
ret = wally_ec_public_key_from_private_key(pk, pk_len, o, o_len);
191+
ret = wally_ec_public_key_from_private_key(pk, pk_len, o, o_len)
192192
self.assertEqual(ret, WALLY_EINVAL)
193193

194194

src/test/test_transaction.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,6 @@ def test_get_taproot_signature_hash(self):
484484
annex = None
485485
annex_len = 0
486486

487-
fn = wally_tx_get_btc_taproot_signature_hash
488487
args = [tx, index, scripts, values, num_values, tapleaf_script, tapleaf_script_len,
489488
key_version, codesep_pos, annex, annex_len, sighash, flags, bytes_out, out_len]
490489

src/test/util.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
from os.path import isfile, abspath
44
from os import urandom
55
import platform
6-
import sys
76

87
# Allow to run from any sub dir
98
SO_EXT = 'dylib' if platform.system() == 'Darwin' else 'dll' if platform.system() == 'Windows' else 'so'

0 commit comments

Comments
 (0)