Skip to content

Commit

Permalink
TDD Pandas - [RED][BUG] We introduced a bug that was not spotted by e…
Browse files Browse the repository at this point in the history
…xisting tests
  • Loading branch information
diligejy committed Jan 20, 2024
1 parent eeb6a25 commit 6a18351
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion PyCon_PL/Readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
1. [Grzegorz Kocjan - Test Driven Pandas](https://youtu.be/oaADte_9u6Q)
- [Folder](./Test_Driven_Pandas/)
- [Link](https://belazy.dev/talks/test-driven-pandas/)
- [Pytest Fixture Ref](https://twpower.github.io/19-about-python-test-fixture)
- [Pytest Fixture Ref](https://twpower.github.io/19-about-python-test-fixture)
- [Typing Module - Optional](https://www.daleseo.com/python-typing/)
8 changes: 5 additions & 3 deletions PyCon_PL/Test_Driven_Pandas/tests/test_gradebook.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def two_students_in_the_same_group() -> pd.DataFrame():
]
return pd.DataFrame(data=students).set_index("NetID")

def test_results_are_grouped_by_student_group_for_students_in_multiple_group():
def test_results_are_grouped_by_student_group_for_students_in_multiple_groups():
students = [{
"ID" : 1,
"Name" : "Doe, John",
Expand All @@ -76,14 +76,16 @@ def test_results_are_grouped_by_student_group_for_students_in_multiple_group():
"Group" : 1,
},{
"ID" : 2,
"Name" : "Alec, Curry",
"NetID" : "AMC53511",
"Name" : "Doe, Second",
"NetID" : "SXD54321",
"Email Address" : "ALEC.CURRY@EXAMPLE.EDU",
"Group" : 2,
}]
students_df = pd.DataFrame(data=students).set_index("NetID")
result = generate_gradebook(students_df=students_df)
assert list(result.keys()) == [1, 2]
assert result[1]['net_id'].tolist() == ['jxd12345']
assert result[2]['net_id'].tolist() == ['sxd54321']

def test_results_group_contains_students_net_id_lowercase(two_students_in_the_same_group):

Expand Down

0 comments on commit 6a18351

Please sign in to comment.