1 #Copyright (C) 2008 Codethink Ltd
3 #This library is free software; you can redistribute it and/or
4 #modify it under the terms of the GNU Lesser General Public
5 #License version 2 as published by the Free Software Foundation.
7 #This program is distributed in the hope that it will be useful,
8 #but WITHOUT ANY WARRANTY; without even the implied warranty of
9 #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 #GNU General Public License for more details.
11 #You should have received a copy of the GNU Lesser General Public License
12 #along with this program; if not, write to the Free Software
13 #Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
15 from cache import AccessibleCache
16 from factory import create_accessible
21 "TestApplicationCache",
24 #------------------------------------------------------------------------------
26 class TestApplicationCache(object):
28 Test application cache. Accesses single AccessibleCache.
31 def __init__(self, connection, bus_name):
32 self._connection = connection
33 self._bus_name = bus_name
34 self._accessible_cache = AccessibleCache(connection, bus_name)
36 def __getitem__(self, key):
37 return self._accessible_cache
39 def __contains__(self, key):
40 if key == self._bus_name:
46 return create_accessible(self,
48 self._accessible_cache.root,
49 interfaces.ATSPI_ACCESSIBLE,
50 connection=self._connection)
52 root = property(fget=get_root)
54 #END----------------------------------------------------------------------------