Skip to content

Commit

Permalink
Add utils for exchange tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tmetzl committed Mar 15, 2024
1 parent 0d30275 commit d0de737
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions e2xgrader/tests/exchange/utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
from nbgrader.coursedir import CourseDirectory


def create_course_dir(
root: str,
course_id: str = "testcourse",
assignment_id: str = "assignment1",
student_id: str = "*",
) -> CourseDirectory:
"""
Create a CourseDirectory object with the specified parameters.
Args:
root (str): The root directory of the course.
course_id (str): The ID of the course.
assignment_id (str): The ID of the assignment.
student_id (str, optional): The ID of the student. Defaults to "".
Returns:
CourseDirectory: The created CourseDirectory object.
"""
coursedir = CourseDirectory()
coursedir.root = root
coursedir.course_id = course_id
coursedir.assignment_id = assignment_id
coursedir.student_id = student_id
return coursedir

0 comments on commit d0de737

Please sign in to comment.