def test_get_higher_paid_employees_simple() -> None: e1 = Employee(1, "Emma Ployee", "Worker", 10000, 50) e2 = Employee(2, "Sue Perior", "Manager", 20000, 30) e3 = Leader(3, "Bigg Boss", "CEO", 50000, 60, "Some Corp.") e1.become_subordinate(e2) e2.become_subordinate(e3) more_than = e2.get_higher_paid_employees() assert len(more_than) == 1 assert more_than[0].name == 'Bigg Boss'
def test_get_higher_paid_employees_advanced() -> None: e1 = Employee(1, "Emma Ployee", "Worker", 52000, 50) e2 = Employee(2, "Sue Perior", "Manager", 50000, 30) e3 = Employee(3, "Robocop", "Worker", 20000, 30) e4 = Leader(4, "Sarah", "CEO", 500000, 30, "Some Corp.") e5 = Employee(5, "Sofia", "Worker", 10000, 30) e6 = Employee(6, "Terry", "Worker", 5000, 30) e7 = Employee(7, "Odysseus", "Worker", 62000, 30) e8 = Employee(8, "Sparrow", "Contract Worker", 60000, 30) e9 = Employee(9, "Nick", "Contract Worker", 70000, 30) e10 = Employee(10, "Theseus", "Contract Worker", 80000, 30) e1.become_subordinate(e2) e3.become_subordinate(e2) e2.become_subordinate(e4) e5.become_subordinate(e2) e6.become_subordinate(e4) e7.become_subordinate(e4) e8.become_subordinate(e1) e9.become_subordinate(e1) e10.become_subordinate(e1) assert e2.get_higher_paid_employees() == [e1, e4, e7, e8, e9, e10]