def test_canteach_1cert_3require() -> None: """Test can teach with 1 cert and 1 requirement""" matylda = Instructor(1, 'Matylda') kickboxing = WorkoutClass('Kickboxing', ['Strength Training', "a", 'B']) assert matylda.can_teach(kickboxing) is False assert matylda.add_certificate('Strength Training') assert matylda.can_teach(kickboxing) is False
def test_instructor() -> None: instructor = Instructor(1, 'Tim Apple') assert instructor.name == 'Tim Apple' assert instructor.get_id() == 1 assert instructor.get_num_certificates() == 0 workout_class = WorkoutClass('Running', ['Strength Training', 'Interval Training']) assert instructor.can_teach(workout_class) is False instructor.add_certificate('Strength Training') assert instructor.can_teach(workout_class) is False instructor.add_certificate('Interval Training') assert instructor.can_teach(workout_class) is True assert instructor.get_num_certificates() == 2
def test_instructor_multiple_certificate_can_teach() -> None: """Test Instructor.can_teach with a single satisfying certificate.""" instructor = Instructor(5, 'Matthew') swimming = WorkoutClass('Swimming', ['Lifeguard', 'test', 'tes']) assert instructor.add_certificate('Lifeguard') assert instructor.can_teach(swimming) is False assert instructor.add_certificate('l') assert instructor.can_teach(swimming) is False assert instructor.add_certificate('tes') assert instructor.can_teach(swimming) is False assert instructor.add_certificate('test') assert instructor.can_teach(swimming) assert instructor.get_num_certificates() == 4
def test_instructor_attributes() -> None: """Test the public attributes of a new instructor.""" instructor = Instructor(5, 'Matthew') assert instructor.get_id() == 5 assert instructor.name == 'Matthew' assert instructor.get_num_certificates() == 0 kickboxing = WorkoutClass('Kickboxing', ['Strength Training']) assert instructor.can_teach(kickboxing) is False
def test_instructor_many_certificate_can_teach_JEN() -> None: """Test Instructor.can_teach with more than necessary amount of certificates.""" instructor = Instructor(5, 'Matthew') swimming = WorkoutClass('Swimming', ['Lifeguard']) assert instructor.add_certificate('Lifeguard') assert instructor.add_certificate('Cross Fit') assert instructor.add_certificate('Personal Trainer') assert instructor.can_teach(swimming)
def test_instructor_one_certificate_can_teach() -> None: """Test Instructor.can_teach with a single satisfying certificate.""" instructor = Instructor(5, 'Matthew') swimming = WorkoutClass('Swimming', ['Lifeguard']) assert instructor.add_certificate('Lifeguard') assert instructor.can_teach(swimming)
def test_instructor_one_certificate_cannot_teach_JEN() -> None: instructor = Instructor(5, 'Matthew') swimming = WorkoutClass('Swimming', ['Lifeguard']) assert instructor.add_certificate('Cross Fit') assert not instructor.can_teach(swimming)