Skip to content

Commit a9bcee5

Browse files
experimenting with windows tests
1 parent 586cd76 commit a9bcee5

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

test/unit/account_info/test_account_info.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -364,9 +364,12 @@ def _make_sqlite_account_info(self, env=None, last_upgrade_to_run=None):
364364
)
365365

366366
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+
)
370373
actual_path = os.path.abspath(account_info.filename)
371374
assert os.path.join(self.home, '.b2_account_info') == actual_path
372375

@@ -375,6 +378,7 @@ def test_uses_xdg_config_home(self, apiver):
375378
account_info = self._make_sqlite_account_info(
376379
env={
377380
'HOME': self.home,
381+
'USERPROFILE': self.home,
378382
XDG_CONFIG_HOME_ENV_VAR: d,
379383
}
380384
)
@@ -393,18 +397,20 @@ def test_uses_existing_file_and_ignores_xdg(self):
393397
account_info = self._make_sqlite_account_info(
394398
env={
395399
'HOME': self.home,
400+
'USERPROFILE': self.home,
396401
XDG_CONFIG_HOME_ENV_VAR: d,
397402
}
398403
)
399-
assert not os.path.exists(os.path.join(d, 'b2'))
400404
actual_path = os.path.abspath(account_info.filename)
401405
assert default_db_file_location == actual_path
406+
assert not os.path.exists(os.path.join(d, 'b2'))
402407

403408
def test_account_info_env_var_overrides_xdg_config_home(self):
404409
with WindowsSafeTempDir() as d:
405410
account_info = self._make_sqlite_account_info(
406411
env={
407412
'HOME': self.home,
413+
'USERPROFILE': self.home,
408414
XDG_CONFIG_HOME_ENV_VAR: d,
409415
B2_ACCOUNT_INFO_ENV_VAR: os.path.join(d, 'b2_account_info'),
410416
}

0 commit comments

Comments
 (0)