@@ -77,20 +77,20 @@ def setup(self, monkeypatch, tmpdir):
77
77
78
78
def test_invalid_profile_name (self ):
79
79
with pytest .raises (ValueError ):
80
- SqliteAccountInfo ._get_user_account_info_path (profile = '&@(*$' )
80
+ SqliteAccountInfo .get_user_account_info_path (profile = '&@(*$' )
81
81
82
82
def test_profile_and_file_name_conflict (self ):
83
83
with pytest .raises (ValueError ):
84
- SqliteAccountInfo ._get_user_account_info_path (file_name = 'foo' , profile = 'bar' )
84
+ SqliteAccountInfo .get_user_account_info_path (file_name = 'foo' , profile = 'bar' )
85
85
86
86
def test_profile_and_env_var_conflict (self , monkeypatch ):
87
87
monkeypatch .setenv (B2_ACCOUNT_INFO_ENV_VAR , 'foo' )
88
88
with pytest .raises (ValueError ):
89
- SqliteAccountInfo ._get_user_account_info_path (profile = 'bar' )
89
+ SqliteAccountInfo .get_user_account_info_path (profile = 'bar' )
90
90
91
91
def test_profile_and_xdg_config_env_var (self , monkeypatch ):
92
92
monkeypatch .setenv (XDG_CONFIG_HOME_ENV_VAR , os .path .join ('~' , 'custom' ))
93
- account_info_path = SqliteAccountInfo ._get_user_account_info_path (profile = 'secondary' )
93
+ account_info_path = SqliteAccountInfo .get_user_account_info_path (profile = 'secondary' )
94
94
assert account_info_path == os .path .expanduser (
95
95
os .path .join ('~' , 'custom' , 'b2' , 'db-secondary.sqlite' )
96
96
)
@@ -102,18 +102,18 @@ def test_profile(self, monkeypatch):
102
102
else :
103
103
expected_path = ('~' , '.b2db-foo.sqlite' )
104
104
105
- account_info_path = SqliteAccountInfo ._get_user_account_info_path (profile = 'foo' )
105
+ account_info_path = SqliteAccountInfo .get_user_account_info_path (profile = 'foo' )
106
106
assert account_info_path == os .path .expanduser (os .path .join (* expected_path ))
107
107
108
108
def test_file_name (self ):
109
- account_info_path = SqliteAccountInfo ._get_user_account_info_path (
109
+ account_info_path = SqliteAccountInfo .get_user_account_info_path (
110
110
file_name = os .path .join ('~' , 'foo' )
111
111
)
112
112
assert account_info_path == os .path .expanduser (os .path .join ('~' , 'foo' ))
113
113
114
114
def test_env_var (self , monkeypatch ):
115
115
monkeypatch .setenv (B2_ACCOUNT_INFO_ENV_VAR , os .path .join ('~' , 'foo' ))
116
- account_info_path = SqliteAccountInfo ._get_user_account_info_path ()
116
+ account_info_path = SqliteAccountInfo .get_user_account_info_path ()
117
117
assert account_info_path == os .path .expanduser (os .path .join ('~' , 'foo' ))
118
118
119
119
def test_default_file_if_exists (self , monkeypatch ):
@@ -124,12 +124,12 @@ def test_default_file_if_exists(self, monkeypatch):
124
124
os .makedirs (parent_dir , exist_ok = True )
125
125
with open (account_file_path , 'w' ) as account_file :
126
126
account_file .write ('' )
127
- account_info_path = SqliteAccountInfo ._get_user_account_info_path ()
127
+ account_info_path = SqliteAccountInfo .get_user_account_info_path ()
128
128
assert account_info_path == os .path .expanduser (B2_ACCOUNT_INFO_DEFAULT_FILE )
129
129
130
130
def test_xdg_config_env_var (self , monkeypatch ):
131
131
monkeypatch .setenv (XDG_CONFIG_HOME_ENV_VAR , os .path .join ('~' , 'custom' ))
132
- account_info_path = SqliteAccountInfo ._get_user_account_info_path ()
132
+ account_info_path = SqliteAccountInfo .get_user_account_info_path ()
133
133
assert account_info_path == os .path .expanduser (
134
134
os .path .join ('~' , 'custom' , 'b2' , 'account_info' )
135
135
)
@@ -141,5 +141,5 @@ def test_default_file(self):
141
141
else :
142
142
expected_path = B2_ACCOUNT_INFO_DEFAULT_FILE
143
143
144
- account_info_path = SqliteAccountInfo ._get_user_account_info_path ()
144
+ account_info_path = SqliteAccountInfo .get_user_account_info_path ()
145
145
assert account_info_path == os .path .expanduser (expected_path )
0 commit comments