'Ensure we can extract users from a passwd file.'

def testOSXUsersParser(self):

    paths = ['/Users/user1', '/Users/user2', '/Users/Shared']
    statentries = []
    for path in paths:
        statentries.append(rdf_client.StatEntry(pathspec=rdf_paths.PathSpec(path=path, pathtype=rdf_paths.PathSpec.PathType.OS), st_mode=16877))
    statentries.append(rdf_client.StatEntry(pathspec=rdf_paths.PathSpec(path='/Users/.localized', pathtype=rdf_paths.PathSpec.PathType.OS), st_mode=33261))
    parser = osx_file_parser.OSXUsersParser()
    out = list(parser.Parse(statentries, None, None))
    self.assertItemsEqual([x.username for x in out], ['user1', 'user2'])
    self.assertItemsEqual([x.homedir for x in out], ['/Users/user1', '/Users/user2'])
