Skip to content

Commit 1218d38

Browse files
authored
BUG: Use upper case environment variable name for windows (#42)
1 parent 657cc52 commit 1218d38

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

msal_requests_auth/cache.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ class EnvironmentTokenCache(_BaseTokenCache):
145145
146146
"""
147147

148-
_environment_variable = "__msal_requests_auth_cache__"
148+
_environment_variable = "__MSAL_REQUESTS_AUTH_CACHE__"
149149

150150
def __init__(self) -> None:
151151
super().__init__()

test/test_cache.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -159,23 +159,23 @@ def test_environment_token_cache(serialize_mock, deserialize_mock):
159159
serialize_mock.return_value = "INPUT FROM CACHE"
160160
with EnvironmentTokenCache() as cache:
161161
cache.has_state_changed = True
162-
assert os.environ == {"__msal_requests_auth_cache__": "INPUT FROM CACHE"}
162+
assert os.environ == {"__MSAL_REQUESTS_AUTH_CACHE__": "INPUT FROM CACHE"}
163163
deserialize_mock.assert_not_called()
164164

165165

166-
@patch.dict(os.environ, {"__msal_requests_auth_cache__": "INPUT"}, clear=True)
166+
@patch.dict(os.environ, {"__MSAL_REQUESTS_AUTH_CACHE__": "INPUT"}, clear=True)
167167
@patch("msal_requests_auth.cache.EnvironmentTokenCache.deserialize")
168168
@patch("msal_requests_auth.cache.EnvironmentTokenCache.serialize")
169169
def test_environment_token_cache__initialized(serialize_mock, deserialize_mock):
170170
serialize_mock.return_value = "INPUT FROM CACHE"
171171
with EnvironmentTokenCache() as cache:
172-
assert os.environ == {"__msal_requests_auth_cache__": "INPUT"}
172+
assert os.environ == {"__MSAL_REQUESTS_AUTH_CACHE__": "INPUT"}
173173
cache.has_state_changed = True
174-
assert os.environ == {"__msal_requests_auth_cache__": "INPUT FROM CACHE"}
174+
assert os.environ == {"__MSAL_REQUESTS_AUTH_CACHE__": "INPUT FROM CACHE"}
175175
deserialize_mock.assert_called_once_with("INPUT")
176176

177177

178-
@patch.dict(os.environ, {"__msal_requests_auth_cache__": "INPUT"}, clear=True)
178+
@patch.dict(os.environ, {"__MSAL_REQUESTS_AUTH_CACHE__": "INPUT"}, clear=True)
179179
@patch("msal_requests_auth.cache._import_keyring")
180180
def test_get_token_cache__keyring(keyring_mock):
181181
class NoKeyringError(Exception):
@@ -199,7 +199,7 @@ class NoKeyringError(Exception):
199199
)
200200

201201

202-
@patch.dict(os.environ, {"__msal_requests_auth_cache__": "INPUT"}, clear=True)
202+
@patch.dict(os.environ, {"__MSAL_REQUESTS_AUTH_CACHE__": "INPUT"}, clear=True)
203203
@patch("msal_requests_auth.cache._import_keyring")
204204
def test_get_token_cache__null(keyring_mock):
205205
class NoKeyringError(Exception):
@@ -225,7 +225,7 @@ class NoKeyringError(Exception):
225225
)
226226

227227

228-
@patch.dict(os.environ, {"__msal_requests_auth_cache__": "INPUT"}, clear=True)
228+
@patch.dict(os.environ, {"__MSAL_REQUESTS_AUTH_CACHE__": "INPUT"}, clear=True)
229229
@patch("msal_requests_auth.cache.EnvironmentTokenCache.deserialize")
230230
def test_get_token_cache__environment(deserialize_mock):
231231
assert isinstance(

0 commit comments

Comments
 (0)