-
Notifications
You must be signed in to change notification settings - Fork 367
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #282 from jeff-sternberg/azuread_tenant_id_traitlet
Use traitlet.default for Azure AD tenant_id
- Loading branch information
Showing
2 changed files
with
7 additions
and
27 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,10 @@ | ||
from pytest import mark | ||
from ..azuread import AzureAdOAuthenticator | ||
|
||
_t_id = 'XXX-XXX-XXXX' | ||
|
||
|
||
class Config(object): | ||
tenant_id = _t_id | ||
|
||
|
||
def test_gettenant_with_tenant_id(): | ||
t_id = AzureAdOAuthenticator.get_tenant(Config()) | ||
assert t_id == _t_id | ||
|
||
|
||
import os | ||
os.environ["AAD_TENANT_ID"] = "some_random_id" | ||
|
||
|
||
def test_gettenant_from_env(): | ||
t_id = AzureAdOAuthenticator.get_tenant(object) | ||
assert t_id.default_value == "some_random_id" | ||
def test_tenant_id_from_env(): | ||
aad = AzureAdOAuthenticator() | ||
assert aad.tenant_id == "some_random_id" |