def testOSXUsersParser(self):
    paths = ["/Users/user1", "/Users/user2", "/Users/Shared"]
    statentries = []
    client = "C.1000000000000000"
    for path in paths:
      statentries.append(rdf_client.StatEntry(
          aff4path=rdf_client.ClientURN(client).Add("fs/os").Add(path),
          pathspec=rdf_paths.PathSpec(path=path,
                                      pathtype=rdf_paths.PathSpec.PathType.OS),
          st_mode=16877))

    statentries.append(rdf_client.StatEntry(
        aff4path=rdf_client.ClientURN(client).Add(
            "fs/os").Add("/Users/.localized"),
        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"])
Ensure we can extract users from a passwd file.
dataset/ETHPy150Open google/grr/grr/parsers/osx_file_parser_test.py/TestOSXFileParsing.testOSXUsersParser