test_OutPortConsumer.py
Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 # -*- Python -*-
00003 
00004 #
00005 #  \file test_OutPortConsumer.py
00006 #  \brief test for OutPortConsumer class
00007 #  \date $Date: 2007/09/19$
00008 #  \author Shinji Kurihara
00009 # 
00010 #  Copyright (C) 2006
00011 #      Noriaki Ando
00012 #      Task-intelligence Research Group,
00013 #      Intelligent Systems Research Institute,
00014 #      National Institute of
00015 #          Advanced Industrial Science and Technology (AIST), Japan
00016 #      All rights reserved.
00017 # 
00018 
00019 import sys
00020 sys.path.insert(1,"../")
00021 
00022 from omniORB import *
00023 from omniORB import any
00024 
00025 import unittest
00026 from OutPortConsumer import *
00027 
00028 import RTC, RTC__POA
00029 
00030 import OpenRTM_aist
00031 
00032 
00033 class ConsumerMock:
00034         def subscribeInterface(self, prop):
00035                 print "subscribeInterface"
00036                 return
00037 
00038         def unsubscribeInterface(self, prop):
00039                 print "unsubscribeInterface"
00040                 return
00041 
00042 
00043 class TestOutPortConsumer(unittest.TestCase):
00044         def setUp(self):
00045                 self._oc = OutPortConsumerFactory.instance()
00046                 return
00047 
00048         def test_OutPortConsumerFactory(self):
00049                 _oc1 = OutPortConsumerFactory.instance()
00050                 self.assertEqual(self._oc, _oc1)
00051                 return
00052 
00053         def test_subscribe(self):
00054                 subs = self._oc.subscribe(None)
00055                 subs(ConsumerMock())
00056                 subs(ConsumerMock())
00057                 subs(ConsumerMock())
00058                 return
00059 
00060         def test_unsubscribe(self):
00061                 subs = self._oc.unsubscribe(None)
00062                 subs(ConsumerMock())
00063                 subs(ConsumerMock())
00064                 subs(ConsumerMock())
00065                 return
00066 
00067 
00068 ############### test #################
00069 if __name__ == '__main__':
00070         unittest.main()


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