def test_empty_list_projection(): """ Test projection operation when using a list that is empty. """ try: project(COMPLETELY_EMPTY1, ["Surname"]) except IndexError: assert True
def test_wrong_column_projection(): """ Test the projection operation when faced with a column head that did not exist, i.e. an Unknown Attribute. """ try: project(EMPTY_LIST, ["Does Not Exist"]) except AttributeError: assert True
def test_project(): """ Test the projection operation. """ result = [["FirstName", "Surname"], ["Hoban", "Washburne"], ["Zoe", "Washburne"], ["Malcolm", "Reynolds"], ["Jayne", "Cobb"], ["Inara", "Serra"]] assert is_equal(result, project(STUDENTS, ["FirstName", "Surname"]))
def test_project(): """ Test the projection operation. """ result = [ ["FirstName", "Surname"], ["Hoban", "Washburne"], ["Zoe", "Washburne"], ["Malcolm", "Reynolds"], ["Jayne", "Cobb"], ["Inara", "Serra"], ] assert is_equal(result, project(STUDENTS, ["FirstName", "Surname"]))