'Test the Cache Grep plugin.'

def testCacheGrep(self):

    for s in flow_test_lib.TestFlowHelper(webhistory.CacheGrep.__name__, self.client_mock, check_flow_errors=False, client_id=self.client_id, grep_users=['test'], data_regex='ENIAC', pathtype=rdf_paths.PathSpec.PathType.TSK, token=self.token):
        session_id = s
    fd = flow.GRRFlow.ResultCollectionForFID(session_id, token=self.token)
    self.assertEqual(len(fd), 1)
    hits = list(fd)
    self.assertIsInstance(hits[0], rdf_client.StatEntry)
    self.assertEqual(hits[0].pathspec.last.path, '/home/test/.config/google-chrome/Default/Cache/data_1')
