| 1 |
# SPDX-License-Identifier: MPL-2.0 |
| 2 |
|
| 3 |
import unittest |
| 4 |
|
| 5 |
from cryptoparser.tls.subprotocol import TlsApplicationDataMessage |
| 6 |
|
| 7 |
|
| 8 |
class TestRecord(unittest.TestCase): |
| 9 |
_APPLICATION_DATA_MESSAGE_BYTES = b'\x01\x02\x03\x04' |
| 10 |
|
| 11 |
def test_error(self): |
| 12 |
pass |
| 13 |
|
| 14 |
def test_parse(self): |
| 15 |
self.assertEqual( |
| 16 |
TlsApplicationDataMessage.parse_exact_size(self._APPLICATION_DATA_MESSAGE_BYTES), |
| 17 |
TlsApplicationDataMessage(data=self._APPLICATION_DATA_MESSAGE_BYTES) |
| 18 |
) |
| 19 |
|
| 20 |
def test_compose(self): |
| 21 |
self.assertEqual( |
| 22 |
self._APPLICATION_DATA_MESSAGE_BYTES, |
| 23 |
TlsApplicationDataMessage(data=self._APPLICATION_DATA_MESSAGE_BYTES).compose() |
| 24 |
) |