Skip to content

Commit

Permalink
Added CLI tests for lms.userget.
Browse files Browse the repository at this point in the history
  • Loading branch information
eriq-augustine committed Sep 5, 2024
1 parent c29453f commit f7ab70b
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 2 deletions.
10 changes: 8 additions & 2 deletions autograder/cli/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,18 @@ def list_users(users, table = False):
_list_users(users)

def _list_users(users, indent = ''):
for user in users:
users = list(users)

for i in range(len(users)):
user = users[i]

if (i != 0):
print()

print(indent + "Email:", user['email'])
print(indent + "Name:", user['name'])
print(indent + "Role:", user['role'])
print(indent + "LMS ID:", user['lms-id'])
print()

def _list_users_table(users, header = True, keys = HEADERS):
if (header):
Expand Down
File renamed without changes.
11 changes: 11 additions & 0 deletions tests/cli/testdata/lms/lms_user_get_base.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"cli": "autograder.cli.lms.user-get",
"arguments": [
"--target-email", "[email protected]"
]
}
---
Email: [email protected]
Name: course-student
Role: student
LMS ID: [email protected]
8 changes: 8 additions & 0 deletions tests/cli/testdata/lms/lms_user_get_missing.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"cli": "autograder.cli.lms.user-get",
"arguments": [
"--target-email", "[email protected]"
]
}
---
No matching autograder user found.

0 comments on commit f7ab70b

Please sign in to comment.