File tree 1 file changed +7
-4
lines changed
1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 17
17
import platform
18
18
import tempfile
19
19
20
+ from b2sdk .utils import TempDir
20
21
import six
21
22
22
23
from .test_base import TestBase
@@ -309,21 +310,23 @@ def test_account_info_persistence(self):
309
310
self ._test_account_info (check_persistence = True )
310
311
311
312
def test_uses_xdg_config_home (self ):
312
- with tempfile . TemporaryDirectory () as d :
313
+ with TempDir () as d :
313
314
account_info = self ._make_sqlite_account_info (env = {'XDG_CONFIG_HOME' : d })
314
315
expected_path = os .path .abspath (os .path .join (d , 'b2' , 'account_info' ))
315
316
actual_path = os .path .abspath (account_info .filename )
316
- assert expected_path == actual_path , 'Actual path %s is not equal to $XDG_CONFIG_HOME/b2/account_info' % (actual_path ,)
317
+ assert expected_path == actual_path , 'Actual path %s is not equal to $XDG_CONFIG_HOME/b2/account_info' % (
318
+ actual_path ,
319
+ )
317
320
assert os .path .exists (
318
321
os .path .join (d , 'b2' )
319
322
), 'Config folder $XDG_CONFIG_HOME/b2 was not created!'
320
323
321
324
def test_account_info_env_var_overrides_xdg_config_home (self ):
322
- with tempfile . TemporaryDirectory () as d :
325
+ with TempDir () as d :
323
326
account_info = self ._make_sqlite_account_info (
324
327
env = {
325
328
'XDG_CONFIG_HOME' : d ,
326
- B2_ACCOUNT_INFO_ENV_VAR : os .path .join (d , 'b2_account_info' )
329
+ B2_ACCOUNT_INFO_ENV_VAR : os .path .join (d , 'b2_account_info' ),
327
330
}
328
331
)
329
332
expected_path = os .path .abspath (os .path .join (d , 'b2_account_info' ))
You can’t perform that action at this time.
0 commit comments