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

def testPasswdBufferParser(self):

    parser = linux_file_parser.PasswdBufferParser()
    buf1 = rdf_client.BufferReference(data='user1:x:1000:1000:User1    Name,,,:/home/user1:/bin/bash\n')
    buf2 = rdf_client.BufferReference(data='user2:x:1000:1000:User2    Name,,,:/home/user2:/bin/bash\n')
    ff_result = rdf_file_finder.FileFinderResult(matches=[buf1, buf2])
    out = list(parser.Parse(ff_result, None))
    self.assertEqual(len(out), 2)
    self.assertTrue(isinstance(out[1], rdf_client.User))
    self.assertTrue(isinstance(out[1], rdf_client.User))
    self.assertEqual(out[0].username, 'user1')
    self.assertEqual(out[0].full_name, 'User1    Name,,,')
