@@ -47,9 +47,8 @@ def wallet_file(name):
47
47
48
48
# create symlink to verify wallet directory path can be referenced
49
49
# through symlink
50
- if os .name != 'nt' :
51
- os .mkdir (wallet_dir ('w7' ))
52
- os .symlink ('w7' , wallet_dir ('w7_symlink' ))
50
+ os .mkdir (wallet_dir ('w7' ))
51
+ os .symlink ('w7' , wallet_dir ('w7_symlink' ))
53
52
54
53
# rename wallet.dat to make sure plain wallet file paths (as opposed to
55
54
# directory paths) can be loaded
@@ -70,11 +69,9 @@ def wallet_file(name):
70
69
# w8 - to verify existing wallet file is loaded correctly
71
70
# '' - to verify default wallet file is created correctly
72
71
wallet_names = ['w1' , 'w2' , 'w3' , 'w' , 'sub/w5' , os .path .join (self .options .tmpdir , 'extern/w6' ), 'w7_symlink' , 'w8' , '' ]
73
- if os .name == 'nt' :
74
- wallet_names .remove ('w7_symlink' )
75
72
extra_args = ['-wallet={}' .format (n ) for n in wallet_names ]
76
73
self .start_node (0 , extra_args )
77
- assert_equal (set (map (lambda w : w ['name' ], self .nodes [0 ].listwalletdir ()['wallets' ])), set (['' , 'w3' , 'w2' , 'sub/ w5' , 'w7' , 'w7' , 'w1' , 'w8' , 'w' ]))
74
+ assert_equal (set (map (lambda w : w ['name' ], self .nodes [0 ].listwalletdir ()['wallets' ])), set (['' , 'w3' , 'w2' , os . path . join ( 'sub' , ' w5') , 'w7' , 'w7' , 'w1' , 'w8' , 'w' ]))
78
75
79
76
assert_equal (set (node .listwallets ()), set (wallet_names ))
80
77
@@ -100,9 +97,8 @@ def wallet_file(name):
100
97
self .nodes [0 ].assert_start_raises_init_error (['-wallet=w8' , '-wallet=w8_copy' ], exp_stderr , match = ErrorMatch .PARTIAL_REGEX )
101
98
102
99
# should not initialize if wallet file is a symlink
103
- if os .name != 'nt' :
104
- os .symlink ('w8' , wallet_dir ('w8_symlink' ))
105
- self .nodes [0 ].assert_start_raises_init_error (['-wallet=w8_symlink' ], 'Error: Invalid -wallet path \' w8_symlink\' \. .*' , match = ErrorMatch .FULL_REGEX )
100
+ os .symlink ('w8' , wallet_dir ('w8_symlink' ))
101
+ self .nodes [0 ].assert_start_raises_init_error (['-wallet=w8_symlink' ], 'Error: Invalid -wallet path \' w8_symlink\' \. .*' , match = ErrorMatch .FULL_REGEX )
106
102
107
103
# should not initialize if the specified walletdir does not exist
108
104
self .nodes [0 ].assert_start_raises_init_error (['-walletdir=bad' ], 'Error: Specified -walletdir "bad" does not exist' )
@@ -148,7 +144,7 @@ def wallet_file(name):
148
144
149
145
self .restart_node (0 , extra_args )
150
146
151
- assert_equal (set (map (lambda w : w ['name' ], self .nodes [0 ].listwalletdir ()['wallets' ])), set (['' , 'w3' , 'w2' , 'sub/ w5' , 'w7' , 'w7' , 'w8_copy' , 'w1' , 'w8' , 'w' ]))
147
+ assert_equal (set (map (lambda w : w ['name' ], self .nodes [0 ].listwalletdir ()['wallets' ])), set (['' , 'w3' , 'w2' , os . path . join ( 'sub' , ' w5') , 'w7' , 'w7' , 'w8_copy' , 'w1' , 'w8' , 'w' ]))
152
148
153
149
wallets = [wallet (w ) for w in wallet_names ]
154
150
wallet_bad = wallet ("bad" )
@@ -235,8 +231,7 @@ def wallet_file(name):
235
231
236
232
237
233
# Fail to load if wallet file is a symlink
238
- if os .name != 'nt' :
239
- assert_raises_rpc_error (- 4 , "Wallet file verification failed: Invalid -wallet path 'w8_symlink'" , self .nodes [0 ].loadwallet , 'w8_symlink' )
234
+ assert_raises_rpc_error (- 4 , "Wallet file verification failed: Invalid -wallet path 'w8_symlink'" , self .nodes [0 ].loadwallet , 'w8_symlink' )
240
235
241
236
# Fail to load if a directory is specified that doesn't contain a wallet
242
237
os .mkdir (wallet_dir ('empty_wallet_dir' ))
@@ -296,7 +291,7 @@ def wallet_file(name):
296
291
assert_equal (self .nodes [0 ].listwallets (), ['w1' ])
297
292
assert_equal (w1 .getwalletinfo ()['walletname' ], 'w1' )
298
293
299
- assert_equal (set (map (lambda w : w ['name' ], self .nodes [0 ].listwalletdir ()['wallets' ])), set (['' , 'w3' , 'w2' , 'sub/ w5' , 'w7' , 'w9' , 'w7' , 'w8_copy' , 'w1' , 'w8' , 'w' ]))
294
+ assert_equal (set (map (lambda w : w ['name' ], self .nodes [0 ].listwalletdir ()['wallets' ])), set (['' , 'w3' , 'w2' , os . path . join ( 'sub' , ' w5') , 'w7' , 'w9' , 'w7' , 'w8_copy' , 'w1' , 'w8' , 'w' ]))
300
295
301
296
# Test backing up and restoring wallets
302
297
self .log .info ("Test wallet backup" )
0 commit comments