18 from omniORB
import any
20 sys.path.insert(1,
"../")
24 import SDOPackage, SDOPackage__POA
28 configsample_spec = [
"implementation_id",
"ConfigSample",
29 "type_name",
"ConfigSample",
30 "description",
"Configuration example component",
32 "vendor",
"Shinji Kurihara, AIST",
33 "category",
"example",
34 "activity_type",
"DataFlowComponent",
37 "lang_type",
"compile",
39 "conf.default.int_param0",
"0",
40 "conf.default.int_param1",
"1",
41 "conf.default.double_param0",
"0.11",
42 "conf.default.double_param1",
"9.9",
43 "conf.default.str_param0",
"hoge",
44 "conf.default.str_param1",
"dara",
45 "conf.default.vector_param0",
"0.0,1.0,2.0,3.0,4.0",
53 OpenRTM_aist.Manager.instance().shutdownManager()
57 self.assertEqual(
newNV(
"long", 1).name,
"long")
58 self.assertEqual(
newNV(
"long", 1).value.value(), 1)
59 self.assertEqual(
newNV(
"float", 1.2345).name,
"float")
60 self.assertEqual(
newNV(
"float", 1.2345).value.value(), 1.2345)
61 self.assertEqual(
newNV(
"string",
"test").name,
"string")
62 self.assertEqual(
newNV(
"string",
"test").value.value(),
"test")
66 self.assertEqual(
newNV(
"bool",
True).name,
"bool")
67 self.assertEqual(
newNV(
"bool",
True).value.value(),
True)
71 self.assertEqual(
newNV(
"oct", 0x01).name,
"oct")
72 self.assertEqual(
newNV(
"oct", 0x01).value.value(), 0x01)
77 self.assertEqual(omniORB.any.from_any(
newNV(
"any",omniORB.any.to_any(12345)).value), 12345)
84 self.assertEqual(nv[0].name,
"implementation_id")
85 self.assertEqual(nv[0].value.value(),
"ConfigSample")
88 self.assertEqual(nv[0].name,
"implementation_id")
89 self.assertEqual(nv[0].value.value(),
"ConfigSample")
96 self.assertEqual(prop.getProperty(
"id0"),
"0")
97 self.assertEqual(prop.getProperty(
"id1"),
"1")
98 self.assertEqual(prop.getProperty(
"id2"),
"2")
99 self.assertEqual(prop.getProperty(
"id3"),
"3")
105 self.assertEqual(prop.getProperty(
"id0").value(), 0)
106 self.assertEqual(prop.getProperty(
"id1").value(), 1)
107 self.assertEqual(prop.getProperty(
"id2").value(), 2)
108 self.assertEqual(prop.getProperty(
"id3").value(), 3)
113 self.assertEqual(
find(nv,
"id0").value(), 0)
114 self.assertEqual(
find(nv,
"id1").value(), 1)
115 self.assertEqual(
find(nv,
"id2").value(), 2)
116 self.assertEqual(
find(nv,
"id3").value(), 3)
129 self.assertEqual(
isString(nv,
"float"),
False)
130 self.assertEqual(
isString(nv,
"long"),
False)
131 self.assertEqual(
isString(nv,
"string"),
True)
132 self.assertEqual(
isString(nv,
"oct"),
False)
145 self.assertEqual(
toString(nv,
"float"),
"")
146 self.assertEqual(
toString(nv,
"long"),
"")
147 self.assertEqual(
toString(nv,
"string"),
"test")
148 self.assertEqual(
toString(nv,
"oct"),
"")
152 nv = [
newNV(
"string",
"test0, test1, test2")]
154 self.assertEqual(any.from_any(nv[0].value),
"test0, test1, test2")
156 self.assertEqual(any.from_any(nv[0].value),
"test0, test1, test2, test3")
162 self.assertEqual(list_,[1,2,3,4,5,6])
166 nv = [
newNV(
"string",
"test0, test1, test2")]
171 if __name__ ==
'__main__':
def test_find_index(self)
def test_copyFromProperties(self)
def test_copyToProperties(self)
def copyToProperties(prop, nvlist)
Copy to Proeprties from NVList.
def test_isStringValue(self)
The Properties class represents a persistent set of properties.
def appendStringValue(nv, name, value)
def test_toProperties(self)
def toString(nv, name=None)
Get string value in NVList specified by name.
def test_newNVOctet(self)
def isStringValue(nv, name, value)
def find(seq, f)
Return the index of CORBA sequence element that functor matches.
def test_appendStringValue(self)
def toProperties(nv)
coil::Properties toProperties(const SDOPackage::NVList& nv);
def copyFromProperties(nv, prop)
Copy to NVList from Proeprties.
def newNV(name, value)
Create NameVale.