@@ -621,39 +621,18 @@ def test_wallet_with_relative_path(self):
621
621
assert_equal (info ["descriptors" ], False )
622
622
assert_equal (info ["format" ], "bdb" )
623
623
624
- def test_wallet_with_path_ending_in_slash (self ):
625
- self .log .info ("Test migrating a wallet with a name/path ending in '/'" )
626
-
627
- # The last directory in the wallet's path
628
- final_dir = "mywallet"
629
- wallet_name = f"path/to/{ final_dir } /"
630
- wallet = self .create_legacy_wallet (wallet_name )
631
- default = self .master_node .get_wallet_rpc (self .default_wallet_name )
632
-
633
- addr = wallet .getnewaddress ()
634
- txid = default .sendtoaddress (addr , 1 )
635
- self .generate (self .master_node , 1 )
636
- bals = wallet .getbalances ()
637
-
638
- _ , wallet = self .migrate_and_get_rpc (wallet_name )
639
-
640
- assert wallet .gettransaction (txid )
641
-
642
- assert_equal (bals , wallet .getbalances ())
643
-
644
- def test_wallet_with_path_ending_in_relative_specifier (self ):
645
- self .log .info ("Test migrating a wallet with a name/path ending in a relative specifier, '..'" )
646
- wallet_ending_in_relative = "path/that/ends/in/.."
624
+ def test_wallet_with_path (self , wallet_path ):
625
+ self .log .info ("Test migrating a wallet with the following path/name: %s" , wallet_path )
647
626
# the wallet data is actually inside of path/that/ends/
648
- wallet = self .create_legacy_wallet (wallet_ending_in_relative )
627
+ wallet = self .create_legacy_wallet (wallet_path )
649
628
default = self .master_node .get_wallet_rpc (self .default_wallet_name )
650
629
651
630
addr = wallet .getnewaddress ()
652
631
txid = default .sendtoaddress (addr , 1 )
653
632
self .generate (self .master_node , 1 )
654
633
bals = wallet .getbalances ()
655
634
656
- _ , wallet = self .migrate_and_get_rpc (wallet_ending_in_relative )
635
+ _ , wallet = self .migrate_and_get_rpc (wallet_path )
657
636
658
637
assert wallet .gettransaction (txid )
659
638
@@ -1558,8 +1537,8 @@ def run_test(self):
1558
1537
self .test_nonexistent ()
1559
1538
self .test_unloaded_by_path ()
1560
1539
self .test_wallet_with_relative_path ()
1561
- self .test_wallet_with_path_ending_in_slash ( )
1562
- self .test_wallet_with_path_ending_in_relative_specifier ( )
1540
+ self .test_wallet_with_path ( "path/to/mywallet/" )
1541
+ self .test_wallet_with_path ( "path/that/ends/in/.." )
1563
1542
self .test_default_wallet ()
1564
1543
self .test_direct_file ()
1565
1544
self .test_addressbook ()
0 commit comments