OpenRTM_aist
test
test_OutPortConsumer.py
Go to the documentation of this file.
1
#!/usr/bin/env python
2
# -*- Python -*-
3
4
#
5
# \file test_OutPortConsumer.py
6
# \brief test for OutPortConsumer class
7
# \date $Date: 2007/09/19$
8
# \author Shinji Kurihara
9
#
10
# Copyright (C) 2006
11
# Noriaki Ando
12
# Task-intelligence Research Group,
13
# Intelligent Systems Research Institute,
14
# National Institute of
15
# Advanced Industrial Science and Technology (AIST), Japan
16
# All rights reserved.
17
#
18
19
import
sys
20
sys.path.insert(1,
"../"
)
21
22
from
omniORB
import
*
23
from
omniORB
import
any
24
25
import
unittest
26
from
OutPortConsumer
import
*
27
28
import
RTC, RTC__POA
29
30
import
OpenRTM_aist
31
32
33
class
ConsumerMock
:
34
def
subscribeInterface
(self, prop):
35
print
"subscribeInterface"
36
return
37
38
def
unsubscribeInterface
(self, prop):
39
print
"unsubscribeInterface"
40
return
41
42
43
class
TestOutPortConsumer
(unittest.TestCase):
44
def
setUp
(self):
45
self.
_oc
= OutPortConsumerFactory.instance()
46
return
47
48
def
test_OutPortConsumerFactory
(self):
49
_oc1 = OutPortConsumerFactory.instance()
50
self.assertEqual(self.
_oc
, _oc1)
51
return
52
53
def
test_subscribe
(self):
54
subs = self.
_oc
.subscribe(
None
)
55
subs(
ConsumerMock
())
56
subs(
ConsumerMock
())
57
subs(
ConsumerMock
())
58
return
59
60
def
test_unsubscribe
(self):
61
subs = self.
_oc
.unsubscribe(
None
)
62
subs(
ConsumerMock
())
63
subs(
ConsumerMock
())
64
subs(
ConsumerMock
())
65
return
66
67
68
69
if
__name__ ==
'__main__'
:
70
unittest.main()
test_OutPortConsumer.TestOutPortConsumer.test_OutPortConsumerFactory
def test_OutPortConsumerFactory(self)
Definition:
test_OutPortConsumer.py:48
test_OutPortConsumer.ConsumerMock.subscribeInterface
def subscribeInterface(self, prop)
Definition:
test_OutPortConsumer.py:34
test_OutPortConsumer.ConsumerMock.unsubscribeInterface
def unsubscribeInterface(self, prop)
Definition:
test_OutPortConsumer.py:38
test_OutPortConsumer.TestOutPortConsumer._oc
_oc
Definition:
test_OutPortConsumer.py:45
test_OutPortConsumer.TestOutPortConsumer
Definition:
test_OutPortConsumer.py:43
test_OutPortConsumer.TestOutPortConsumer.setUp
def setUp(self)
Definition:
test_OutPortConsumer.py:44
test_OutPortConsumer.TestOutPortConsumer.test_subscribe
def test_subscribe(self)
Definition:
test_OutPortConsumer.py:53
test_OutPortConsumer.TestOutPortConsumer.test_unsubscribe
def test_unsubscribe(self)
Definition:
test_OutPortConsumer.py:60
test_OutPortConsumer.ConsumerMock
Definition:
test_OutPortConsumer.py:33
openrtm_aist_python
Author(s): Shinji Kurihara
autogenerated on Mon Feb 28 2022 23:01:07