OpenRTM_aist
test
test_InPortPullConnector.py
Go to the documentation of this file.
1
#!/usr/bin/env python
2
# -*- Python -*-
3
4
5
# \file test_InPortPullConnector.py
6
# \brief test for InPortPullConnector 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
InPortPullConnector
import
*
24
25
import
RTC, RTC__POA
26
import
OpenRTM_aist
27
28
class
InPortConsumerMock
:
29
_buffer =
None
30
31
def
setBuffer
(self, buff):
32
self.
_buffer
= buff
33
34
def
setListener
(self, info, listener):
35
pass
36
37
def
get
(self, data):
38
return
OpenRTM_aist.DataPortStatus.PORT_OK
39
40
class
TestInPortPullConnector
(unittest.TestCase):
41
def
setUp
(self):
42
OpenRTM_aist.Manager.instance()
43
self.
_con
=
InPortPullConnector
(
OpenRTM_aist.ConnectorInfo
(
"name"
,
"id"
,[],
OpenRTM_aist.Properties
()),
InPortConsumerMock
(),
OpenRTM_aist.ConnectorListeners
())
44
45
def
test_read
(self):
46
data = []
47
self.assertEqual(self.
_con
.read(data),OpenRTM_aist.BufferStatus.PRECONDITION_NOT_MET)
48
return
49
50
def
test_disconnect
(self):
51
self.assertEqual(self.
_con
.disconnect(),OpenRTM_aist.DataPortStatus.PORT_OK)
52
return
53
54
def
test_activate
(self):
55
self.
_con
.activate()
56
return
57
58
def
test_deactivate
(self):
59
self.
_con
.deactivate()
60
return
61
62
def
test_createBuffer
(self):
63
self.
_con
.createBuffer(
OpenRTM_aist.ConnectorInfo
(
"name"
,
"id"
,[],
OpenRTM_aist.Properties
()))
64
return
65
66
67
68
69
70
if
__name__ ==
'__main__'
:
71
unittest.main()
72
OpenRTM_aist.ConnectorBase.ConnectorInfo
Definition:
ConnectorBase.py:31
test_InPortPullConnector.TestInPortPullConnector._con
_con
Definition:
test_InPortPullConnector.py:43
OpenRTM_aist.ConnectorListener.ConnectorListeners
Definition:
ConnectorListener.py:762
test_InPortPullConnector.TestInPortPullConnector.test_createBuffer
def test_createBuffer(self)
Definition:
test_InPortPullConnector.py:62
test_InPortPullConnector.TestInPortPullConnector.setUp
def setUp(self)
Definition:
test_InPortPullConnector.py:41
test_InPortPullConnector.TestInPortPullConnector.test_activate
def test_activate(self)
Definition:
test_InPortPullConnector.py:54
test_InPortPullConnector.InPortConsumerMock.setBuffer
def setBuffer(self, buff)
Definition:
test_InPortPullConnector.py:31
test_InPortPullConnector.TestInPortPullConnector.test_deactivate
def test_deactivate(self)
Definition:
test_InPortPullConnector.py:58
test_InPortPullConnector.TestInPortPullConnector
Definition:
test_InPortPullConnector.py:40
test_InPortPullConnector.TestInPortPullConnector.test_read
def test_read(self)
Definition:
test_InPortPullConnector.py:45
test_InPortPullConnector.InPortConsumerMock.setListener
def setListener(self, info, listener)
Definition:
test_InPortPullConnector.py:34
InPortPullConnector
OpenRTM_aist.Properties.Properties
Definition:
Properties.py:83
test_InPortPullConnector.TestInPortPullConnector.test_disconnect
def test_disconnect(self)
Definition:
test_InPortPullConnector.py:50
test_InPortPullConnector.InPortConsumerMock._buffer
_buffer
Definition:
test_InPortPullConnector.py:29
test_InPortPullConnector.InPortConsumerMock.get
def get(self, data)
Definition:
test_InPortPullConnector.py:37
test_InPortPullConnector.InPortConsumerMock
Definition:
test_InPortPullConnector.py:28
openrtm_aist_python
Author(s): Shinji Kurihara
autogenerated on Mon Apr 21 2025 02:45:07