'Test that the Find flow works with glob.'

def testFindFilesWithGlob(self):

    client_mock = action_mocks.ActionMock(searching.Find)
    findspec = rdf_client.FindSpec(path_glob='bash*', pathspec=rdf_paths.PathSpec(path='/', pathtype=rdf_paths.PathSpec.PathType.OS))
    for s in flow_test_lib.TestFlowHelper(find.FindFiles.__name__, client_mock, client_id=self.client_id, token=self.token, findspec=findspec):
        session_id = s
    fd = flow.GRRFlow.ResultCollectionForFID(session_id, token=self.token)
    matches = set([x.AFF4Path(self.client_id).Basename() for x in fd])
    self.assertEqual(sorted(matches), ['bash'])
    self.assertEqual(len(fd), 2)
    for child in fd:
        path = utils.SmartStr(child.AFF4Path(self.client_id))
        self.assertTrue(path.endswith('bash'))
        self.assertEqual(child.__class__.__name__, 'StatEntry')
