@@ -364,9 +364,12 @@ def _make_sqlite_account_info(self, env=None, last_upgrade_to_run=None):
364
364
)
365
365
366
366
def test_uses_default (self ):
367
- account_info = self ._make_sqlite_account_info (env = {
368
- 'HOME' : self .home ,
369
- })
367
+ account_info = self ._make_sqlite_account_info (
368
+ env = {
369
+ 'HOME' : self .home ,
370
+ 'USERPROFILE' : self .home ,
371
+ }
372
+ )
370
373
actual_path = os .path .abspath (account_info .filename )
371
374
assert os .path .join (self .home , '.b2_account_info' ) == actual_path
372
375
@@ -375,6 +378,7 @@ def test_uses_xdg_config_home(self, apiver):
375
378
account_info = self ._make_sqlite_account_info (
376
379
env = {
377
380
'HOME' : self .home ,
381
+ 'USERPROFILE' : self .home ,
378
382
XDG_CONFIG_HOME_ENV_VAR : d ,
379
383
}
380
384
)
@@ -393,18 +397,20 @@ def test_uses_existing_file_and_ignores_xdg(self):
393
397
account_info = self ._make_sqlite_account_info (
394
398
env = {
395
399
'HOME' : self .home ,
400
+ 'USERPROFILE' : self .home ,
396
401
XDG_CONFIG_HOME_ENV_VAR : d ,
397
402
}
398
403
)
399
- assert not os .path .exists (os .path .join (d , 'b2' ))
400
404
actual_path = os .path .abspath (account_info .filename )
401
405
assert default_db_file_location == actual_path
406
+ assert not os .path .exists (os .path .join (d , 'b2' ))
402
407
403
408
def test_account_info_env_var_overrides_xdg_config_home (self ):
404
409
with WindowsSafeTempDir () as d :
405
410
account_info = self ._make_sqlite_account_info (
406
411
env = {
407
412
'HOME' : self .home ,
413
+ 'USERPROFILE' : self .home ,
408
414
XDG_CONFIG_HOME_ENV_VAR : d ,
409
415
B2_ACCOUNT_INFO_ENV_VAR : os .path .join (d , 'b2_account_info' ),
410
416
}
0 commit comments