'Test the find action.'

def testFindAction(self):

    pathspec = rdf_paths.PathSpec(path='/mock2/', pathtype=rdf_paths.PathSpec.PathType.OS)
    request = rdf_client.FindSpec(pathspec=pathspec, path_regex='.')
    request.iterator.number = 200
    result = self.RunAction(searching.Find, request)
    all_files = [x.hit for x in result if isinstance(x, rdf_client.FindSpec)]
    files = []
    request = rdf_client.FindSpec(pathspec=pathspec, path_regex='.')
    request.iterator.number = 1
    while True:
        result = self.RunAction(searching.Find, request)
        if (request.iterator.state == rdf_client.Iterator.State.FINISHED):
            break
        self.assertEqual(len(result), 2)
        self.assertTrue(isinstance(result[0], rdf_client.FindSpec))
        self.assertTrue(isinstance(result[1], rdf_client.Iterator))
        files.append(result[0].hit)
        request.iterator = result[1].Copy()
    for (x, y) in zip(all_files, files):
        self.assertRDFValuesEqual(x, y)
    self.assertEqual(request.iterator.state, rdf_client.Iterator.State.FINISHED)
    self.assertEqual(len(request.iterator.client_state.dat), 0)
