21 sys.path.insert(1,
"../")
25 from ObjectManager
import *
44 self.
_name = factory.getInstanceName()
50 return self.
_name == factory.getInstanceName()
60 self._modlist.append(f.getProperty(
"implementation_id"))
68 OpenRTM_aist.Manager.instance().shutdownManager()
73 self.assertEqual(self.obj.registerObject(obj),
True,
"Result failed.")
74 self.assertEqual(self.obj.registerObject(obj),
False,
"Result failed.")
79 self.assertEqual(self.obj.unregisterObject(
"test").getInstanceName(),
"test",
"Result failed.")
80 self.assertEqual(self.obj.unregisterObject(
"test"),
None,
"Result failed.")
87 self.assertEqual(self.obj.find(
"test").getInstanceName(),
"test",
"Result failed.")
88 self.assertEqual(self.obj.find(
"testtest"),
None,
"Result failed.")
93 self.obj.registerObject(obj)
95 self.obj.registerObject(obj)
97 self.obj.registerObject(obj)
98 self.assertEqual(len(self.obj.getObjects()),3,
"Result failed.")
99 self.assertEqual(self.obj.getObjects()[0].getInstanceName(),
"test0",
"Result failed.")
100 self.assertEqual(self.obj.getObjects()[1].getInstanceName(),
"test1",
"Result failed.")
101 self.assertEqual(self.obj.getObjects()[2].getInstanceName(),
"test2",
"Result failed.")
106 self.obj.registerObject(obj)
108 self.obj.registerObject(obj)
110 self.obj.registerObject(obj)
112 self.assertEqual(len(self.obj.for_each(self.
ModuleFactories)._modlist),3,
"Result failed.")
116 if __name__ ==
'__main__':
def test_registerObject(self)
def getInstanceName(self)
def __init__(self, name=None, factory=None)
def __call__(self, factory)
def getProperty(self, name)
def test_getObjects(self)
def test_unregisterObject(self)