def test_get_department_name() -> None:
    e2 = Employee(3, 'Joe', 'Worker', 10000, 50)
    assert e2.get_department_name() == ''
    l = Leader(1, 'Lena', 'LEADER', 100000, 100, 'Department')
    assert l.get_department_name() == 'Department'
    e1 = Employee(2, 'Mama', 'Anna', 50000, 100)
    e1.become_subordinate(l)
    assert e1.get_department_name() == 'Department'
    e2.become_subordinate(e1)
    assert e2.get_department_name() == 'Department'
Ejemplo n.º 2
0
def test_become_each_other() -> None:
    e1 = Leader(1, "Sarah", "CEO", 500000, 30, "Some Corp.")
    e2 = Employee(2, "Sandra", "Secretary", 20000, 30)
    e3 = Employee(3, "Sofia", "Manager", 25000, 40)
    e2.become_subordinate(e1)
    e3.become_subordinate(e2)
    assert e3.get_department_name() == 'Some Corp.'
    lol = e2.become_leader('chloeisamazingandneedschicken')
    assert isinstance(lol.get_employee(2), Leader)
    assert e3.get_department_name() == 'chloeisamazingandneedschicken'
    lol = e1.become_employee()
    assert isinstance(lol.get_employee(1), Employee)
    assert isinstance(lol.get_employee(1), Leader) == False
    assert lol.get_employee(1).get_department_name() == ''
    assert len(lol.get_employee(1).get_all_subordinates()) == 2
    assert lol.get_employee(2).get_department_name() == \
           'chloeisamazingandneedschicken'
Ejemplo n.º 3
0
def test_get_department_name() -> None:
    e1 = Employee(1, "Emma Ployee", "Worker", 10000, 50)
    assert e1.get_department_name() == ''
    e2 = Leader(2, "Sue Perior", "Manager", 20000, 30, "Department")
    e1.become_subordinate(e2)
    assert e1.get_department_name() == 'Department'