test_InPortPushConnector.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 # -*- Python -*-
3 
4 
5 # \file test_InPortPushConnector.py
6 # \brief test for InPortPushConnector class
7 # \date $Date: 2007/09/20 $
8 # \author Shinji Kurihara
9 #
10 # Copyright (C) 2003-2005
11 # Task-intelligence Research Group,
12 # Intelligent Systems Research Institute,
13 # National Institute of
14 # Advanced Industrial Science and Technology (AIST), Japan
15 # All rights reserved.
16 
17 
18 import sys
19 sys.path.insert(1,"../")
20 
21 import unittest
22 
23 from InPortPushConnector import *
24 
25 import RTC, RTC__POA
26 import OpenRTM_aist
27 from OpenRTM_aist import *
28 
29 
31  _buffer = None
32  _prop = None
33 
34  def init(self, prop):
35  self._prop = prop
36 
37  def setBuffer(self, buff):
38  self._buffer = buff
39 
40  def setListener(self, info, listener):
41  pass
42 
43 
44 class TestInPortPushConnector(unittest.TestCase):
45  def setUp(self):
46  OpenRTM_aist.Manager.instance()
48 
49  def test_read(self):
50  data = []
51  self.assertEqual(self._con.read(data),OpenRTM_aist.DataPortStatus.BUFFER_TIMEOUT)
52  data = 123
53  self.assertEqual(self._con.read(data),OpenRTM_aist.DataPortStatus.BUFFER_TIMEOUT)
54  return
55 
56  def test_disconnect(self):
57  self.assertEqual(self._con.disconnect(),OpenRTM_aist.DataPortStatus.PORT_OK)
58  return
59 
60  def test_activate(self):
61  self._con.activate()
62  return
63 
64  def test_deactivate(self):
65  self._con.deactivate()
66  return
67 
68  def test_createBuffer(self):
69  self._con.createBuffer(OpenRTM_aist.ConnectorInfo("name","id",[],OpenRTM_aist.Properties()))
70  return
71 
72 
73 
74 
75 
76 if __name__ == '__main__':
77  unittest.main()
78 
test_InPortPushConnector.InPortProviderMock.init
def init(self, prop)
Definition: test_InPortPushConnector.py:34
test_InPortPushConnector.InPortProviderMock._buffer
_buffer
Definition: test_InPortPushConnector.py:31
OpenRTM_aist.ConnectorBase.ConnectorInfo
Definition: ConnectorBase.py:31
test_InPortPushConnector.InPortProviderMock.setBuffer
def setBuffer(self, buff)
Definition: test_InPortPushConnector.py:37
OpenRTM_aist.ConnectorListener.ConnectorListeners
Definition: ConnectorListener.py:762
test_InPortPushConnector.TestInPortPushConnector.test_disconnect
def test_disconnect(self)
Definition: test_InPortPushConnector.py:56
test_InPortPushConnector.InPortProviderMock._prop
_prop
Definition: test_InPortPushConnector.py:32
test_InPortPushConnector.InPortProviderMock
Definition: test_InPortPushConnector.py:30
test_InPortPushConnector.InPortProviderMock.setListener
def setListener(self, info, listener)
Definition: test_InPortPushConnector.py:40
test_InPortPushConnector.TestInPortPushConnector.test_activate
def test_activate(self)
Definition: test_InPortPushConnector.py:60
test_InPortPushConnector.TestInPortPushConnector.setUp
def setUp(self)
Definition: test_InPortPushConnector.py:45
test_InPortPushConnector.TestInPortPushConnector._con
_con
Definition: test_InPortPushConnector.py:47
OpenRTM_aist.InPortPushConnector.InPortPushConnector
InPortPushConnector class.
Definition: InPortPushConnector.py:76
OpenRTM_aist.Properties.Properties
Definition: Properties.py:83
test_InPortPushConnector.TestInPortPushConnector.test_deactivate
def test_deactivate(self)
Definition: test_InPortPushConnector.py:64
test_InPortPushConnector.TestInPortPushConnector.test_read
def test_read(self)
Definition: test_InPortPushConnector.py:49
test_InPortPushConnector.TestInPortPushConnector.test_createBuffer
def test_createBuffer(self)
Definition: test_InPortPushConnector.py:68


openrtm_aist_python
Author(s): Shinji Kurihara
autogenerated on Mon Apr 21 2025 02:45:07