Main Page
Namespaces
Classes
Files
File List
test
internal
test_outgoing_message.py
Go to the documentation of this file.
1
#!/usr/bin/env python
2
import
rostest
3
import
sys
4
import
unittest
5
6
from
rosbridge_library.internal.outgoing_message
import
OutgoingMessage
7
from
std_msgs.msg
import
String
8
9
10
class
TestOutgoingMessage
(unittest.TestCase):
11
def
test_json_values
(self):
12
msg = String(data=
"foo"
)
13
outgoing =
OutgoingMessage
(msg)
14
15
result = outgoing.get_json_values()
16
self.assertEqual(result[
'data'
], msg.data)
17
18
again = outgoing.get_json_values()
19
self.assertTrue(result
is
again)
20
21
def
test_cbor_values
(self):
22
msg = String(data=
"foo"
)
23
outgoing =
OutgoingMessage
(msg)
24
25
result = outgoing.get_cbor_values()
26
self.assertEqual(result[
'data'
], msg.data)
27
28
again = outgoing.get_cbor_values()
29
self.assertTrue(result
is
again)
30
31
32
PKG =
'rosbridge_library'
33
NAME =
'test_outgoing_message'
34
if
__name__ ==
'__main__'
:
35
rostest.unitrun(PKG, NAME, TestOutgoingMessage)
test.internal.test_outgoing_message.TestOutgoingMessage.test_cbor_values
def test_cbor_values(self)
Definition:
test_outgoing_message.py:21
test.internal.test_outgoing_message.TestOutgoingMessage.test_json_values
def test_json_values(self)
Definition:
test_outgoing_message.py:11
test.internal.test_outgoing_message.TestOutgoingMessage
Definition:
test_outgoing_message.py:10
rosbridge_library.internal.outgoing_message
Definition:
outgoing_message.py:1
rosbridge_library.internal.outgoing_message.OutgoingMessage
Definition:
outgoing_message.py:5
msg
rosbridge_library
Author(s): Jonathan Mace
autogenerated on Wed Jun 3 2020 03:55:14