'Assert that two lists of L{Project}s are equal.'

def assertProjectsEqual(self, observedProjects, expectedProjects):

    self.assertEqual(len(observedProjects), len(expectedProjects))
    observedProjects = sorted(observedProjects, key=operator.attrgetter('directory'))
    expectedProjects = sorted(expectedProjects, key=operator.attrgetter('directory'))
    for (observed, expected) in zip(observedProjects, expectedProjects):
        self.assertEqual(observed.directory, expected.directory)
