test_InPortPullConnector.py
Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 # -*- Python -*-
00003 
00004 
00005 #  \file test_InPortPullConnector.py
00006 #  \brief test for InPortPullConnector class
00007 #  \date $Date: 2007/09/20 $
00008 #  \author Shinji Kurihara
00009 # 
00010 #  Copyright (C) 2003-2005
00011 #      Task-intelligence Research Group,
00012 #      Intelligent Systems Research Institute,
00013 #      National Institute of
00014 #          Advanced Industrial Science and Technology (AIST), Japan
00015 #      All rights reserved.
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 ############### test #################
00070 if __name__ == '__main__':
00071   unittest.main()
00072 


openrtm_aist_python
Author(s): Shinji Kurihara
autogenerated on Thu Aug 27 2015 14:17:28