Skip to content

Commit 7ff5ff2

Browse files
committed
Merge branch 'refine-ssh-cert-test' into dev
2 parents d6db249 + f88f26b commit 7ff5ff2

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

tests/msaltest.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,18 @@ def _select_options(
3434
return raw_data
3535

3636
def _input_scopes():
37-
return _select_options([
37+
scopes = _select_options([
3838
"https://graph.microsoft.com/.default",
3939
"https://management.azure.com/.default",
4040
"User.Read",
4141
"User.ReadBasic.All",
4242
],
4343
header="Select a scope (multiple scopes can only be input by manually typing them, delimited by space):",
4444
accept_nonempty_string=True,
45-
).split()
45+
).split() # It also converts the input string(s) into a list
46+
if "https://pas.windows.net/CheckMyAccess/Linux/.default" in scopes:
47+
raise ValueError("SSH Cert scope shall be tested by its dedicated functions")
48+
return scopes
4649

4750
def _select_account(app):
4851
accounts = app.get_accounts()
@@ -183,6 +186,8 @@ def main():
183186
], option_renderer=lambda f: f.__doc__, header="MSAL Python APIs:")
184187
try:
185188
func(app)
189+
except ValueError as e:
190+
logging.error("Invalid input: %s", e)
186191
except KeyboardInterrupt: # Useful for bailing out a stuck interactive flow
187192
print("Aborted")
188193

0 commit comments

Comments
 (0)