-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add pickling support * update * update * update * update * update * typing * black * update * update * updates * black * update * update changelog
- Loading branch information
1 parent
da82787
commit 8b921c4
Showing
8 changed files
with
118 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# ------------------------------------ | ||
# Copyright (c) Microsoft Corporation. | ||
# Licensed under the MIT License. | ||
# ------------------------------------ | ||
import pickle | ||
from azure.identity import DefaultAzureCredential | ||
from azure.identity._internal.msal_credentials import MsalCredential | ||
|
||
|
||
def test_pickle_dac(): | ||
cred = DefaultAzureCredential() | ||
with open("data.pkl", "wb") as outfile: | ||
pickle.dump(cred, outfile) | ||
with open("data.pkl", "rb") as infile: | ||
data_loaded = pickle.load(infile) | ||
|
||
|
||
def test_pickle_msal_credential(): | ||
cred = MsalCredential(client_id="CLIENT_ID") | ||
app = cred._get_app() | ||
with open("data.pkl", "wb") as outfile: | ||
pickle.dump(cred, outfile) | ||
with open("data.pkl", "rb") as infile: | ||
data_loaded = pickle.load(infile) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# ------------------------------------ | ||
# Copyright (c) Microsoft Corporation. | ||
# Licensed under the MIT License. | ||
# ------------------------------------ | ||
import pickle | ||
from azure.identity.aio import DefaultAzureCredential | ||
|
||
|
||
def test_pickle_dac(): | ||
cred = DefaultAzureCredential() | ||
with open("data_aio.pkl", "wb") as outfile: | ||
pickle.dump(cred, outfile) | ||
with open("data_aio.pkl", "rb") as infile: | ||
data_loaded = pickle.load(infile) |