refactor: E275 missing whitespace after keyword

This commit is contained in:
tecnovert committed 2022-07-31 20:09:43 +02:00
1 parent 1601a57aed
commit 1c4f208d27
29 files changed
+295 -295

No files matched your search

+1 -1
View File
@@ -59,7 +59,7 @@ def run_test():
driver.get(base_url)
link = driver.find_element_by_xpath('//a[@href="/offers"]')
num_offers_end = int(link.text.split(':')[1].strip())
assert(num_offers_end == num_offers_start + 1)
assert num_offers_end == num_offers_start + 1
driver.quit()
+14 -14
View File
@@ -319,11 +319,11 @@ class Test(unittest.TestCase):
ro = nmcRpc('getblockchaininfo')
try:
assert(ro['bip9_softforks']['csv']['status'] == 'active')
assert (ro['bip9_softforks']['csv']['status'] == 'active')
except Exception:
logging.info('nmc: csv is not active')
try:
assert(ro['bip9_softforks']['segwit']['status'] == 'active')
assert (ro['bip9_softforks']['segwit']['status'] == 'active')
except Exception:
logging.info('nmc: segwit is not active')
@@ -354,7 +354,7 @@ class Test(unittest.TestCase):
if particl_blocks >= num_blocks:
break
delay_event.wait(1)
assert(particl_blocks >= num_blocks)
assert (particl_blocks >= num_blocks)
@classmethod
def tearDownClass(cls):
@@ -382,7 +382,7 @@ class Test(unittest.TestCase):
wait_for_offer(delay_event, swap_clients[1], offer_id)
offers = swap_clients[1].listOffers()
assert(len(offers) == 1)
assert (len(offers) == 1)
for offer in offers:
if offer.offer_id == offer_id:
bid_id = swap_clients[1].postBid(offer_id, offer.amount_from)
@@ -398,8 +398,8 @@ class Test(unittest.TestCase):
js_0 = read_json_api(1800)
js_1 = read_json_api(1801)
assert(js_0['num_swapping'] == 0 and js_0['num_watched_outputs'] == 0)
assert(js_1['num_swapping'] == 0 and js_1['num_watched_outputs'] == 0)
assert (js_0['num_swapping'] == 0 and js_0['num_watched_outputs'] == 0)
assert (js_1['num_swapping'] == 0 and js_1['num_watched_outputs'] == 0)
def test_03_nmc_part(self):
logging.info('---------- Test NMC to PART')
@@ -423,8 +423,8 @@ class Test(unittest.TestCase):
js_0 = read_json_api(1800)
js_1 = read_json_api(1801)
assert(js_0['num_swapping'] == 0 and js_0['num_watched_outputs'] == 0)
assert(js_1['num_swapping'] == 0 and js_1['num_watched_outputs'] == 0)
assert (js_0['num_swapping'] == 0 and js_0['num_watched_outputs'] == 0)
assert (js_1['num_swapping'] == 0 and js_1['num_watched_outputs'] == 0)
def test_04_nmc_btc(self):
logging.info('---------- Test NMC to BTC')
@@ -451,8 +451,8 @@ class Test(unittest.TestCase):
js_0 = read_json_api(1800)
js_1 = read_json_api(1801)
assert(js_0['num_swapping'] == 0 and js_0['num_watched_outputs'] == 0)
assert(js_1['num_swapping'] == 0 and js_1['num_watched_outputs'] == 0)
assert (js_0['num_swapping'] == 0 and js_0['num_watched_outputs'] == 0)
assert (js_1['num_swapping'] == 0 and js_1['num_watched_outputs'] == 0)
def test_05_refund(self):
# Seller submits initiate txn, buyer doesn't respond
@@ -477,8 +477,8 @@ class Test(unittest.TestCase):
js_0 = read_json_api(1800)
js_1 = read_json_api(1801)
assert(js_0['num_swapping'] == 0 and js_0['num_watched_outputs'] == 0)
assert(js_1['num_swapping'] == 0 and js_1['num_watched_outputs'] == 0)
assert (js_0['num_swapping'] == 0 and js_0['num_watched_outputs'] == 0)
assert (js_1['num_swapping'] == 0 and js_1['num_watched_outputs'] == 0)
def test_06_self_bid(self):
logging.info('---------- Test same client, BTC to NMC')
@@ -501,8 +501,8 @@ class Test(unittest.TestCase):
wait_for_bid(delay_event, swap_clients[0], bid_id, BidStates.SWAP_COMPLETED, wait_for=60)
js_0 = read_json_api(1800)
assert(js_0['num_swapping'] == 0 and js_0['num_watched_outputs'] == 0)
assert(js_0['num_recv_bids'] == js_0_before['num_recv_bids'] + 1 and js_0['num_sent_bids'] == js_0_before['num_sent_bids'] + 1)
assert (js_0['num_swapping'] == 0 and js_0['num_watched_outputs'] == 0)
assert (js_0['num_recv_bids'] == js_0_before['num_recv_bids'] + 1 and js_0['num_sent_bids'] == js_0_before['num_sent_bids'] + 1)
def test_07_error(self):
logging.info('---------- Test error, BTC to NMC, set fee above bid value')
+6 -6
View File
@@ -82,19 +82,19 @@ class Test(unittest.TestCase):
waitForServer(self.delay_event, 12700)
wallets_0 = read_json_api(12700, 'wallets')
assert(wallets_0['PART']['expected_seed'] is True)
assert(wallets_0['XMR']['expected_seed'] is True)
assert (wallets_0['PART']['expected_seed'] is True)
assert (wallets_0['XMR']['expected_seed'] is True)
waitForServer(self.delay_event, 12701)
wallets_1 = read_json_api(12701, 'wallets')
assert(wallets_0['PART']['expected_seed'] is True)
assert(wallets_1['XMR']['expected_seed'] is True)
assert (wallets_0['PART']['expected_seed'] is True)
assert (wallets_1['XMR']['expected_seed'] is True)
# TODO: Check other coins
assert(wallets_0['PART']['deposit_address'] == wallets_1['1']['deposit_address'])
assert(wallets_0['XMR']['deposit_address'] == wallets_1['6']['deposit_address'])
assert (wallets_0['PART']['deposit_address'] == wallets_1['1']['deposit_address'])
assert (wallets_0['XMR']['deposit_address'] == wallets_1['6']['deposit_address'])
except Exception:
traceback.print_exc()
@@ -139,7 +139,7 @@ class Test(TestBase):
offer_id = post_json_api(12700, 'offers/new', data)['offer_id']
summary = read_json_api(12700)
assert(summary['num_sent_offers'] == 1)
assert (summary['num_sent_offers'] == 1)
logger.info('Waiting for offer')
waitForNumOffers(self.delay_event, 12701, 1)
@@ -170,8 +170,8 @@ class Test(TestBase):
ltc_original = read_json_api(12700, 'wallets/ltc')
ltc_restored = read_json_api(12703, 'wallets/ltc')
assert(float(ltc_original['balance']) + float(ltc_original['unconfirmed']) > 0.0)
assert(float(ltc_original['balance']) + float(ltc_original['unconfirmed']) == float(ltc_restored['balance']) + float(ltc_restored['unconfirmed']))
assert (float(ltc_original['balance']) + float(ltc_original['unconfirmed']) > 0.0)
assert (float(ltc_original['balance']) + float(ltc_original['unconfirmed']) == float(ltc_restored['balance']) + float(ltc_restored['unconfirmed']))
wallets_original = read_json_api(12700, 'wallets')
# TODO: After restoring a new deposit address should be generated, should be automated
@@ -180,7 +180,7 @@ class Test(TestBase):
next_addr = read_json_api(12703, 'wallets/part/nextdepositaddr')
wallets_restored = read_json_api(12703, 'wallets')
for k, w in wallets_original.items():
assert(w['deposit_address'] == wallets_restored[k]['deposit_address'])
assert (w['deposit_address'] == wallets_restored[k]['deposit_address'])
logging.info('Test passed.')
@@ -183,7 +183,7 @@ class Test(unittest.TestCase):
self.delay_event.wait(1)
logging.info('PART blocks: %d', callpartrpc(0, 'getblockchaininfo')['blocks'])
assert(particl_blocks >= num_blocks)
assert particl_blocks >= num_blocks
@classmethod
def tearDownClass(cls):