def test_add_colleague(): actor1 = Actor("Angelina Jolie") actor2 = Actor("Brad Pitt") assert actor1.check_if_this_actor_worked_with(actor2) == False actor1.add_actor_colleague(actor2) assert actor1.check_if_this_actor_worked_with(actor2) == True assert actor2.check_if_this_actor_worked_with(actor1) == True
def test_actor_check_if_this_actor_worked_with(): actor_1 = Actor("Angelina Jolie") actor_2 = Actor("Tom Cruise") actor_3 = Actor("Chris Pratt") actor_1.add_actor_colleague(actor_2) assert actor_1.check_if_this_actor_worked_with(actor_2) is True assert actor_1.check_if_this_actor_worked_with(actor_3) is False
def test_actor_add_actor_colleague(): actor_1 = Actor("Angelina Jolie") actor_2 = Actor("Tom Cruise") # add new object not of type Actor actor_1.add_actor_colleague(50) assert len(actor_1.colleagues) == 0 # add new colleague actor_1.add_actor_colleague(actor_2) assert actor_1.colleagues[0] == actor_2 # add existing colleague actor_1.add_actor_colleague(actor_2) assert len(actor_1.colleagues) == 1 # add a second colleague actor_3 = Actor("Chris Pratt") actor_1.add_actor_colleague(actor_3) assert len(actor_1.colleagues) == 2 assert actor_1.colleagues[1] == actor_3