Skip to content

Commit

Permalink
TDD Pandas - [RED] Second Test for creating grouped result
Browse files Browse the repository at this point in the history
  • Loading branch information
diligejy committed Jan 19, 2024
1 parent de14ccb commit 214f70a
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion PyCon_PL/Test_Driven_Pandas/tests/test_gradebook.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,25 @@ def test_results_are_grouped_by_student_group():
students_df = pd.DataFrame(data=students).set_index("ID")

result = generate_gradebook(students_df=students_df)
assert list(result.keys()) == [1]
assert list(result.keys()) == [1]

def test_results_are_grouped_by_student_group_for_students_in_multiple_group():
students = [{
"ID" : 1,
"Name" : "Doe, John",
"NetID" : "JXD12345",
"Email Address" : "JOHN.DOE@EXAMPLE.EDU",
"Group" : 1,
},{
"ID" : 2,
"Name" : "Alec, Curry ",
"NetID" : "AMC53511",
"Email Address" : "ALEC.CURRY@EXAMPLE.EDU",
"Group" : 2,
}]
students_df = pd.DataFrame(data=students).set_index("ID")
result = generate_gradebook(students_df=students_df)
assert list(result.keys()) == [1, 2]



0 comments on commit 214f70a

Please sign in to comment.