'Test that glob expands directories.'

def testGlobDirectory(self):

    client = aff4.FACTORY.Open(self.client_id, mode='rw', token=self.token)
    kb = client.Get(client.Schema.KNOWLEDGE_BASE)
    kb.MergeOrAddUser(rdf_client.User(username='test', appdata='test_data/index.dat'))
    kb.MergeOrAddUser(rdf_client.User(username='test2', appdata='test_data/History'))
    kb.MergeOrAddUser(rdf_client.User(username='test3', appdata='%%PATH%%'))
    client.Set(kb)
    client.Close()
    client_mock = action_mocks.GlobClientMock()
    path = os.path.join(os.path.dirname(self.base_path), '%%users.appdata%%')
    for _ in flow_test_lib.TestFlowHelper(filesystem.Glob.__name__, client_mock, client_id=self.client_id, paths=[path], token=self.token):
        pass
    path = self.client_id.Add('fs/os').Add(self.base_path).Add('index.dat')
    aff4.FACTORY.Open(path, aff4_type=aff4_grr.VFSFile, token=self.token)
    path = self.client_id.Add('fs/os').Add(self.base_path).Add('index.dat')
    aff4.FACTORY.Open(path, aff4_type=aff4_grr.VFSFile, token=self.token)
