File tree Expand file tree Collapse file tree
manage_breast_screening/dicom Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99
1010@patch (f"{ TokenValidator .__module__ } .logger" )
1111class TestTokenValidator :
12+ @pytest .fixture (autouse = True )
13+ def setup_env (self ):
14+ with patch .dict (
15+ "os.environ" ,
16+ {
17+ "API_AUDIENCE" : "test_audience" ,
18+ "TENANT_ID" : "test_tenant_id" ,
19+ "BYPASS_API_TOKEN_AUTH" : "false" ,
20+ },
21+ ):
22+ yield
23+
1224 @pytest .fixture
1325 def mock_urlopen_response (self ):
1426 return {
Original file line number Diff line number Diff line change 1414class TokenValidator (HttpBearer ):
1515 def __init__ (self ):
1616 self .bypass_auth = os .getenv ("BYPASS_API_TOKEN_AUTH" , "false" ).lower () == "true"
17- self .api_audience = os .getenv ( "API_AUDIENCE" , "" )
18- self .tenant_id = os .getenv ( "TENANT_ID" , "" )
17+ self .api_audience = os .environ [ "API_AUDIENCE" ]
18+ self .tenant_id = os .environ [ "TENANT_ID" ]
1919 self .discovery_keys_url = (
2020 "https://login.microsoftonline.com/"
2121 + self .tenant_id
You can’t perform that action at this time.
0 commit comments