test_DataPortStatus.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 # -*- Python -*-
3 
4 #
5 # \file test_DataPortStatus.py
6 # \brief test for CorbaPort class
7 # \date $Date: 2007/09/27 $
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 import OpenRTM_aist
19 import RTC, RTC__POA
20 
21 import sys
22 sys.path.insert(1,"../")
23 
24 import unittest
25 
26 from DataPortStatus import *
27 
28 
29 class TestDataPortStatus(unittest.TestCase):
30  def setUp(self):
32 
33 
34  def test_toString(self):
35  self.assertEqual(self._dps.toString(DataPortStatus.PORT_OK), "PORT_OK")
36  self.assertEqual(self._dps.toString(DataPortStatus.PORT_ERROR), "PORT_ERROR")
37  self.assertEqual(self._dps.toString(DataPortStatus.BUFFER_FULL), "BUFFER_FULL")
38  self.assertEqual(self._dps.toString(DataPortStatus.BUFFER_EMPTY), "BUFFER_EMPTY")
39  self.assertEqual(self._dps.toString(DataPortStatus.BUFFER_TIMEOUT), "BUFFER_TIMEOUT")
40  self.assertEqual(self._dps.toString(DataPortStatus.SEND_FULL), "SEND_FULL")
41  self.assertEqual(self._dps.toString(DataPortStatus.SEND_TIMEOUT), "SEND_TIMEOUT")
42  self.assertEqual(self._dps.toString(DataPortStatus.RECV_EMPTY), "RECV_EMPTY")
43  self.assertEqual(self._dps.toString(DataPortStatus.RECV_TIMEOUT), "RECV_TIMEOUT")
44  self.assertEqual(self._dps.toString(DataPortStatus.INVALID_ARGS), "INVALID_ARGS")
45  self.assertEqual(self._dps.toString(DataPortStatus.PRECONDITION_NOT_MET), "PRECONDITION_NOT_MET")
46  self.assertEqual(self._dps.toString(DataPortStatus.CONNECTION_LOST), "CONNECTION_LOST")
47  self.assertEqual(self._dps.toString(DataPortStatus.UNKNOWN_ERROR), "UNKNOWN_ERROR")
48 
49 
50 
51 if __name__ == '__main__':
52  unittest.main()
def toString(nv, name=None)
Get string value in NVList specified by name.
Definition: NVUtil.py:311


openrtm_aist_python
Author(s): Shinji Kurihara
autogenerated on Mon Feb 28 2022 23:01:07