Description
The current implementation of the test_getSupervisors function, in test_tracy.py, checks if the people in the demo data are in a predetermined list.
This means that adding any new supervisor to the demo data breaks this test until it is set again. Create an implementation of this that does not require it to assert a predetermined list of supervisors.
test_getSupervisorsForDepartment, in test_search.py, is also a brittle function in this file. It checks the length of the list of supervisors compared to an expected outcome. This breaks whenever a new supervisor is added to the Computer Science (Department 1) department.
Notes:
The test_getSupervisors looks something like this: assert s.FIRST_NAME in ['Alex', 'Brian', ...] and assert s.CPO in ['222', '888', '6301', ...].
This doesn't test whether the function is grabbing new supervisors; it just checks whether the ones in the database are ALL grabbed when the query runs, which is why it crashes when a new supervisor is added.
The test_getSupervisorsForDepartment looks like this: assert len(supervisors) == 12
Description
The current implementation of the
test_getSupervisorsfunction, intest_tracy.py, checks if the people in the demo data are in a predetermined list.This means that adding any new supervisor to the demo data breaks this test until it is set again. Create an implementation of this that does not require it to assert a predetermined list of supervisors.
test_getSupervisorsForDepartment, intest_search.py, is also a brittle function in this file. It checks the length of the list of supervisors compared to an expected outcome. This breaks whenever a new supervisor is added to the Computer Science (Department 1) department.Notes:
The
test_getSupervisorslooks something like this:assert s.FIRST_NAME in ['Alex', 'Brian', ...]andassert s.CPO in ['222', '888', '6301', ...].This doesn't test whether the function is grabbing new supervisors; it just checks whether the ones in the database are ALL grabbed when the query runs, which is why it crashes when a new supervisor is added.
The
test_getSupervisorsForDepartmentlooks like this:assert len(supervisors) == 12