@@ -19,9 +19,9 @@ def test_single_operation(subtensor, alice_wallet, bob_wallet):
19
19
assert subtensor .register_subnet (alice_wallet , True , True )
20
20
21
21
# Verify subnet <netuid> created successfully
22
- assert subtensor .subnet_exists (
23
- alice_subnet_netuid
24
- ), "Subnet wasn't created successfully"
22
+ assert subtensor .subnet_exists (alice_subnet_netuid ), (
23
+ "Subnet wasn't created successfully"
24
+ )
25
25
26
26
assert wait_to_start_call (subtensor , alice_wallet , alice_subnet_netuid )
27
27
@@ -325,9 +325,9 @@ def test_safe_staking_scenarios(subtensor, alice_wallet, bob_wallet):
325
325
assert subtensor .register_subnet (alice_wallet , True , True )
326
326
327
327
# Verify subnet created successfully
328
- assert subtensor .subnet_exists (
329
- alice_subnet_netuid
330
- ), "Subnet wasn't created successfully"
328
+ assert subtensor .subnet_exists (alice_subnet_netuid ), (
329
+ "Subnet wasn't created successfully"
330
+ )
331
331
332
332
assert wait_to_start_call (subtensor , alice_wallet , alice_subnet_netuid )
333
333
@@ -395,9 +395,9 @@ def test_safe_staking_scenarios(subtensor, alice_wallet, bob_wallet):
395
395
netuid = alice_subnet_netuid ,
396
396
)
397
397
assert partial_stake > Balance (0 ), "Partial stake should be added"
398
- assert (
399
- partial_stake < stake_amount
400
- ), "Partial stake should be less than requested amount"
398
+ assert partial_stake < stake_amount , (
399
+ "Partial stake should be less than requested amount"
400
+ )
401
401
402
402
# 3. Higher threshold - should succeed fully
403
403
amount = Balance .from_tao (100 )
@@ -444,9 +444,9 @@ def test_safe_staking_scenarios(subtensor, alice_wallet, bob_wallet):
444
444
logging .console .info (f"[orange]Current stake: { current_stake } [orange]" )
445
445
logging .console .info (f"[orange]Full stake: { full_stake } [orange]" )
446
446
447
- assert (
448
- current_stake == full_stake
449
- ), "Stake should not change after failed unstake attempt"
447
+ assert current_stake == full_stake , (
448
+ "Stake should not change after failed unstake attempt"
449
+ )
450
450
451
451
# 2. Partial allowed - should succeed partially
452
452
success = subtensor .unstake (
@@ -563,9 +563,9 @@ def test_safe_swap_stake_scenarios(subtensor, alice_wallet, bob_wallet):
563
563
alice_wallet .hotkey .ss58_address ,
564
564
netuid = dest_netuid ,
565
565
)
566
- assert dest_stake == Balance (
567
- 0
568
- ), "Destination stake should remain 0 after failed swap"
566
+ assert dest_stake == Balance (0 ), (
567
+ "Destination stake should remain 0 after failed swap"
568
+ )
569
569
570
570
# 2. Try swap with higher threshold and less amount - should succeed
571
571
stake_swap_amount = Balance .from_tao (100 )
@@ -594,9 +594,9 @@ def test_safe_swap_stake_scenarios(subtensor, alice_wallet, bob_wallet):
594
594
alice_wallet .hotkey .ss58_address ,
595
595
netuid = dest_netuid ,
596
596
)
597
- assert dest_stake > Balance (
598
- 0
599
- ), "Destination stake should be non-zero after successful swap"
597
+ assert dest_stake > Balance (0 ), (
598
+ "Destination stake should be non-zero after successful swap"
599
+ )
600
600
logging .console .success (
601
601
f"✅ Test [green]test_safe_swap_stake_scenarios[/green] passed"
602
602
)
@@ -611,9 +611,9 @@ def test_move_stake(subtensor, alice_wallet, bob_wallet):
611
611
612
612
alice_subnet_netuid = subtensor .get_total_subnets () # 2
613
613
assert subtensor .register_subnet (alice_wallet , True , True )
614
- assert subtensor .subnet_exists (
615
- alice_subnet_netuid
616
- ), "Subnet wasn't created successfully"
614
+ assert subtensor .subnet_exists (alice_subnet_netuid ), (
615
+ "Subnet wasn't created successfully"
616
+ )
617
617
618
618
assert wait_to_start_call (subtensor , alice_wallet , alice_subnet_netuid )
619
619
@@ -650,9 +650,9 @@ def test_move_stake(subtensor, alice_wallet, bob_wallet):
650
650
651
651
bob_subnet_netuid = subtensor .get_total_subnets () # 3
652
652
subtensor .register_subnet (bob_wallet , True , True )
653
- assert subtensor .subnet_exists (
654
- bob_subnet_netuid
655
- ), "Subnet wasn't created successfully"
653
+ assert subtensor .subnet_exists (bob_subnet_netuid ), (
654
+ "Subnet wasn't created successfully"
655
+ )
656
656
657
657
assert wait_to_start_call (subtensor , bob_wallet , bob_subnet_netuid )
658
658
@@ -716,9 +716,9 @@ def test_transfer_stake(subtensor, alice_wallet, bob_wallet, dave_wallet):
716
716
alice_subnet_netuid = subtensor .get_total_subnets () # 2
717
717
718
718
assert subtensor .register_subnet (alice_wallet , True , True )
719
- assert subtensor .subnet_exists (
720
- alice_subnet_netuid
721
- ), "Subnet wasn't created successfully"
719
+ assert subtensor .subnet_exists (alice_subnet_netuid ), (
720
+ "Subnet wasn't created successfully"
721
+ )
722
722
723
723
assert wait_to_start_call (subtensor , alice_wallet , alice_subnet_netuid )
724
724
0 commit comments