def test_add_alias_empty_alias(self): #ARRANGE instructor = Instructor() instructor.aliases = '' new_alias = ' Instructor_A ' #ACT instructor.add_alias(new_alias) new_aliases_list = instructor.aliases_list #ASSERT self.assertIsNotNone(new_aliases_list) self.assertEqual(len(new_aliases_list), 1) self.assertIn('Instructor_A', new_aliases_list)
def test_add_alias_duplicate_alias(self): #ARRANGE instructor = Instructor() instructor.aliases = 'Aimee McCabe - Karr; Teacher 1; Instructor_A' new_alias = ' instructor_a ' #ACT instructor.add_alias(new_alias) new_aliases_list = instructor.aliases_list #ASSERT self.assertIsNotNone(new_aliases_list) self.assertEqual(len(new_aliases_list), 3) self.assertIn('Aimee McCabe - Karr', new_aliases_list) self.assertIn('Teacher 1', new_aliases_list) self.assertIn('Instructor_A', new_aliases_list)