Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 import sys
00019 sys.path.insert(1,"../")
00020
00021 import unittest
00022
00023 from InPortPullConnector import *
00024
00025 import RTC, RTC__POA
00026 import OpenRTM_aist
00027
00028 class InPortConsumerMock:
00029 _buffer = None
00030
00031 def setBuffer(self, buff):
00032 self._buffer = buff
00033
00034 def setListener(self, info, listener):
00035 pass
00036
00037 def get(self, data):
00038 return OpenRTM_aist.DataPortStatus.PORT_OK
00039
00040 class TestInPortPullConnector(unittest.TestCase):
00041 def setUp(self):
00042 OpenRTM_aist.Manager.instance()
00043 self._con = InPortPullConnector(OpenRTM_aist.ConnectorInfo("name","id",[],OpenRTM_aist.Properties()),InPortConsumerMock(),OpenRTM_aist.ConnectorListeners())
00044
00045 def test_read(self):
00046 data = []
00047 self.assertEqual(self._con.read(data),OpenRTM_aist.BufferStatus.PRECONDITION_NOT_MET)
00048 return
00049
00050 def test_disconnect(self):
00051 self.assertEqual(self._con.disconnect(),OpenRTM_aist.DataPortStatus.PORT_OK)
00052 return
00053
00054 def test_activate(self):
00055 self._con.activate()
00056 return
00057
00058 def test_deactivate(self):
00059 self._con.deactivate()
00060 return
00061
00062 def test_createBuffer(self):
00063 self._con.createBuffer(OpenRTM_aist.ConnectorInfo("name","id",[],OpenRTM_aist.Properties()))
00064 return
00065
00066
00067
00068
00069
00070 if __name__ == '__main__':
00071 unittest.main()
00072