test_OutPortCorbaCdrConsumer.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 # -*- Python -*-
3 
4 #
5 # \file test_OutPortCorbaCdrConsumer.py
6 # \brief test for OutPortCorbaCdrConsumer class
7 # \date $Date: 2007/09/26 $
8 # \author Shinji Kurihara
9 #
10 # Copyright (C) 2006
11 # Noriaki Ando
12 # Task-intelligence Research Group,
13 # Intelligent Systems Research Institute,
14 # National Institute of
15 # Advanced Industrial Science and Technology (AIST), Japan
16 # All rights reserved.
17 
18 from omniORB import any
19 from omniORB import CORBA
20 
21 import OpenRTM_aist
22 import RTC, RTC__POA
23 import SDOPackage, SDOPackage__POA
24 
25 import sys
26 sys.path.insert(1,"../")
27 
28 import unittest
29 
30 from OutPortCorbaCdrConsumer import *
31 
33  def empty():
34  return False
35 
36  def read(cdr):
37  cdr[0] = 123
38  return 0
39 
40 class TestOutPortCorbaCdrConsumer(unittest.TestCase):
41 
42  def setUp(self):
43  OpenRTM_aist.Manager.instance()
44  OpenRTM_aist.OutPortCorbaCdrProviderInit()
46  self._opp.setBuffer(DummyBuffer())
48  return
49 
50  def test_setBuffer(self):
51  self._opcc.setBuffer(DummyBuffer())
52  return
53 
54  def COMMENTtest_get(self):
55  data = [None]
56  self.assertEqual(self._opcc.subscribeInterface(self._opp._properties),True)
57  self.assertEqual(self._opcc.get(data),OpenRTM_aist.DataPortStatus.PORT_OK)
58  self.assertEqual(data[0],123)
59  return
60 
62  self.assertEqual(self._opcc.subscribeInterface(self._opp._properties),True)
63  return
64 
66  self._opcc.unsubscribeInterface(self._opp._properties)
67  return
68 
69 
70 ############### test #################
71 if __name__ == '__main__':
72  unittest.main()


openrtm_aist_python
Author(s): Shinji Kurihara
autogenerated on Thu Jun 6 2019 19:11:34